/**********************************************
* utility.js                                  *
***********************************************/
function pencere(u, w, h, x) {
    var param;
    //var x;
    param = '';
    param = param + 'directories=no';
    param = param + ',location=no';
    param = param + ',menubar=no';
    param = param + ',resizable=yes';
    param = param + ',status=no';
    param = param + ',toolbar=no';
    param = param + ',scrollbars=yes';
    param = param + ',top=20';
    param = param + ',left=20';
    param = param + ',width=' + w;
    param = param + ',height=' + h;
    window.open(u, x, param);
}

function FlashYaz(id,w,h,source, wm, bgc, fvar, StartTag, EndTag)
{
	if (wm=='t') wmode='transparent';
	else wmode='opaque';

	document.writeln(StartTag);
	document.writeln('<object width="' + w + '" height="' + h + '" id="' + id + '" align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">');
	document.writeln('<param name="movie" value="' + source + '" />');
	document.writeln('<param name="bgcolor" value="' + bgc + '" />');
	document.writeln('<param name="wmode" value="' + wmode + '" />');
	document.writeln('<param name="FlashVars" value="' + fvar + '" />');
	document.writeln('<param name="allowScriptAccess" value="sameDomain" />');
	document.writeln('<param name="menu" value="false" />');
	document.writeln('<param name="scale" value="noscale" />');
	document.writeln('<param name="quality" value="high" />');
	document.writeln('<param name="salign" value="t" />');
	document.writeln('<embed id="' + id + '" name="' + id + '" src="' + source + '" quality="high" flashvars="' + fvar + '" wmode="' + wmode + '" bgcolor="' + bgc + '" width="' + w + '" height="' + h + '" align="middle" salign="t" menu="false" scale="noscale" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.writeln('</object>');
	document.writeln(EndTag);
}

function getElement(ElementID) 
{
    var element = document.getElementById(ElementID);
    return element;
}
function SetDivOnOff(divID)
{
    var element = getElement(divID);
    if (element.style.display == 'none')
    {
        SetDivOn (divID);
        return true;
    }
    else
    {
        SetDivOff(divID);
        return false;
    }
}
function SetDivOff(divID)
{
    var element = getElement(divID);
    element.style.display = 'none';
}
function SetDivOn(divID) {
    var element = getElement(divID);
    element.style.display = 'inline';
}


function SetVisibility(divID)
{
    var element = getElement(divID);
    if (element.style.visibility == 'hidden')
    {
        SetVisible(divID);
        return true;
    }
    else
    {
        SetHidden(divID);
        return false;
    }
}
function SetHidden(divID)
{
    var element = getElement(divID);
    element.style.visibility = 'hidden';
}
function SetVisible(divID)
{
    var element = getElement(divID);
    element.style.visibility = 'visible';
}

MasterInformationOn = function(info)
{
    SetVisible('divMasterInformation');
    getElement('divMasterInformation').innerHTML = info;
    
}

MasterInformationOff = function()
{
    SetHidden('divMasterInformation');
}

openBaloon = function(_w, _h, _divID)
{
	if (document.getElementById)
	{
	    var balon = document.getElementById(_divID);
    }
    if (document.all)
	{
	    var balon = document.all[_divID];
    }
    balon.style.visibility = 'visible';
    balon.style.height = _h + 'px';
    balon.style.width = _w + 'px';
    balon.style.display = 'inline';
    
    //balon.style.left = mouse_coord[0] + 'px';
    //balon.style.top = mouse_coord[1] + 'px';
}

closeBaloon = function(_divID)
{
    if (document.getElementById)
	{
	    var balon = document.getElementById(_divID);
    }
    if (document.all)
	{
	    var balon = document.all[_divID];
    }
    balon.style.visibility = 'hidden';
    balon.style.top = 0;
    balon.style.left = 0;
    balon.style.width = 1;
    balon.style.height = 1;
}

CheckAllCheckBoxes = function(checkboxName)
{
    var theForm = document.forms['aspnetForm'];
    if (!theForm) {
        theForm = document.aspnetForm;
    }
    for (var i = 0; i < theForm.length; i++)
    {				
	    if (theForm.elements[i].type == "checkbox" && theForm.elements[i].name.indexOf(checkboxName) > 0)
	    {
		    theForm.elements[i].checked = document.getElementById('checkAllItem').checked;
	    }
    }
}
setoffselectboxes = function()
{
    var theForm = document.forms['aspnetForm'];
    if (!theForm) {
        theForm = document.aspnetForm;
    }
    for (var i = 0; i < theForm.length; i++)
    {				
        if (theForm.elements[i].type == "select-one" || theForm.elements[i].type == "select-multiple")
        {
            theForm.elements[i].style.visibility = 'hidden';
        }
    }
}
setonselectboxes = function()
{
    var theForm = document.forms['aspnetForm'];
    if (!theForm) {
        theForm = document.aspnetForm;
    }
    for (var i = 0; i < theForm.length; i++)
    {				
        if (theForm.elements[i].type == "select-one" || theForm.elements[i].type == "select-multiple")
        {
            theForm.elements[i].style.visibility = 'visible';
        }
    }
}

var tablo_ilk_renk;
var setMouseOverColor = function(element, renk) {
    tablo_ilk_renk = element.style.backgroundColor;
    element.style.backgroundColor = renk;
    element.style.cursor = 'pointer';
}
var setMouseOutColor = function(element) {
    element.style.backgroundColor = tablo_ilk_renk;
}
function changeRowColor(element) {
    tablo_ilk_renk = '#624e37';
    element.style.backgroundColor = tablo_ilk_renk;
}

function getWindowHeight() {
    if (self.innerHeight) return self.innerHeight;
    if (document.documentElement && document.documentElement.clientHeight)
        return document.documentElement.clientHeight;
    if (document.body) return document.body.clientHeight;
    return 0;
};

function getWindowWidth() {
    if (self.innerWidth) return self.innerWidth;
    if (document.documentElement && document.documentElement.clientWidth)
        return document.documentElement.clientWidth;
    if (document.body) return document.body.clientWidth;
    return 0;
};
function OpenPrinterFirendly(url) {
    pencere('/PrinterFriendly.aspx?url=' + url, '800', '600', 'PrinterFirendly');
}
//-->