var win = null;

browserName = navigator.appName;          
browserVer = parseInt(navigator.appVersion);

hasImageSupport = false;
buttonName = new Array ('disease_info');



/*
for (var cnt=0; cnt < buttonName.length; cnt++) {
	eval ('var '+buttonName[cnt]+'_on = new Image();');
	eval (buttonName[cnt] + '_on.src = "/images/'+myLanguage+'/btn_' + buttonName[cnt] + '_on.gif"');
	eval ('var '+buttonName[cnt]+'_off = new Image();');
	eval (buttonName[cnt] + '_off.src = "/images/'+myLanguage+'/btn_' + buttonName[cnt] + '_off.gif"');
}	
*/

function launchWindow (target, width, height, features,url)
{
	if (features)
		features = "," + features;
		
	var str = "height=" + height + ",innerHeight=" + height;
	str += ",width=" + width + ",innerWidth=" + width + features;
	win = window.open(url,target, str);
} 



function resizeWidth (percent)
{
	//get window dimensions
	var myWidth = 0;
	
	//Non-IE
	if( typeof( window.innerWidth ) == 'number' )
	{
		myWidth = window.innerWidth;
	} 
	else
	{
		//IE 6+ in 'standards compliant mode'
		if ( document.documentElement && ( document.documentElement.clientWidth ) )
		{
			myWidth = document.documentElement.clientWidth;
		} 
		//IE 4 compatible
		else if ( document.body && ( document.body.clientWidth ) )
		{
			myWidth = document.body.clientWidth;
		}
	}

	return  Math.round ((percent / 100) * myWidth);
}


function resizeHeight (percent)
{
	//get window dimensions
	var myHeight = 0;
	
	//Non-IE
	if( typeof( window.innerHeight ) == 'number' )
	{
		myHeight = window.innerHeight;
	} 
	else
	{
		//IE 6+ in 'standards compliant mode'
		if ( document.documentElement && ( document.documentElement.clientHeight ) )
		{
			myHeight = document.documentElement.clientHeight;
		} 
		//IE 4 compatible
		else if ( document.body && ( document.body.clientHeight ) )
		{
			myHeight = document.body.clientHeight;
		}
	}

	return  Math.round ((percent / 100) * myHeight);
}


function launchWindow2 (target, features,url)
{
	var height = resizeHeight (80);
	var width = resizeWidth (80);
	if (features)
		features = ',' + features;
		
	var str = "height=" + height + ",innerHeight=" + height;str += ",width=" + width + ",innerWidth=" + width + features;
	
	win = window.open(url,target, str);
}


if (browserName == "Netscape" && browserVer >= 3)
   hasImageSupport = true;
else if (browserVer > 3)
   hasImageSupport = true;

function buttonAction (imgName, isItOn)
{   
	if (hasImageSupport)
	{
		if (isItOn)
		{	  
			hideAll();
			document[imgName].src = eval(imgName + "_on.src");
		}
		else
		{ 
            document[imgName].src = eval (imgName + "_off.src");
		}
	}
}

function reload () {
    window.close ();
}


function doCollapse (divName) 
{
	if (divName)
	{
		if (document.getElementById("d_"+divName).className == "invisible")
		{
			document.getElementById("d_"+divName).className = 'visible';
			document["b_"+divName].src = "images/icon_collapsed.gif";
		}
		else
		{
			document.getElementById("d_"+divName).className = 'invisible';
			document["b_"+divName].src = "images/icon_uncollapsed.gif";
		}
	}
}


function fixedDropMenu (is_on, idname)
{
	if (document.getElementById(idname) != null && !isMac && ieBrowser)
	{
		if (is_on)
		{
			document.getElementById(idname).className = 'invisible';
			document.getElementById(idname+"_off").className = 'visible';
		}
		else
		{
			document.getElementById(idname).className = 'visible';
			document.getElementById(idname+"_off").className = 'invisible';			
		}
	}

}