// JavaScript Document
/**********************
Function to open a window, in the middle of the screen with the specified parameters
Author: Veerabhadra G Kandur - ITAbode
Parameters:
url - location of the target file
height - height of the window to be opened
width - width ot the window to be opened
bWindowLocation - Specifies the lcoation of the window, MIDDLE,TOP_LEFT,TOP_RIGHT,BOTTOM_LEFT,BOTTOM_RIGHT
bResize - should the window be resizable
bScrollBars - should the window be having scrolling enabled
bFocus - should be focused moment the window is opened
***********************/
function openPopup (url, height, width, winname, bWindowLocation, bResize, bScrollBars,bFocus)
{
	// set smaller window size, resize it after load.
	var sFeatures = "";
	//only hardcode values if its an association popup
	if (bWindowLocation == "MIDDLE")
	{
		sFeatures = "status=yes,height=" + height;
		sFeatures += ",width=" + width;
		sFeatures += ",top=" + (screen.availHeight - height)/2;
		sFeatures += ",left=" + (screen.availWidth - width)/2;
	}
	else if(bWindowLocation == "TOP_RIGHT")
	{
		sFeatures = "status=yes,height=" + height;
		sFeatures += ",width=" + width;
		sFeatures += ",top=0";
		sFeatures += ",left=" + (screen.availWidth - (width + 20));		
	}
	else if(bWindowLocation == "TOP_LEFT")
	{
		sFeatures = "status=yes,height=" + height;
		sFeatures += ",width=" + width;
		sFeatures += ",top=0";
		sFeatures += ",left=0";	
	}
	else if(bWindowLocation == "BOTTOM_LEFT")
	{
		sFeatures = "status=yes,height=" + height;
		sFeatures += ",width=" + width;
		sFeatures += ",top=" + (screen.availHeight - (height + 20));
		sFeatures += ",left=0";	
	}
	else if(bWindowLocation == "BOTTOM_RIGHT")
	{
		sFeatures = "status=yes,height=" + height;
		sFeatures += ",width=" + width;
		sFeatures += ",top=" + (screen.availHeight - (height + 20));
		sFeatures += ",left=" + (screen.availWidth - (width + 20));
	}
	else
	{
		sFeatures = "status=yes,height=" + height;
		sFeatures += ",width=" + width;
	}
	
	if(bScrollBars)
	{
		sFeatures += ",scrollbars=yes";
	}
	else
	{
		sFeatures += ",scrollbars=no";
	}
	
	if(bResize)
	{
		sFeatures += ",resizable=yes";
	}
	else
	{
		sFeatures += ",resizable=no";
	}
	
	oWindow=window.open(url,winname,sFeatures);
	
	if(bFocus)
	{
		oWindow.focus();
	}
	else
	{
		//do nothing
	}
}

/* ******************** images button gif********************** */

	function MM_swapImageOnMouseOver(imgName)
	{
		document.getElementsByName(imgName)[0].src = '../images/' + imgName + '_s.gif';
		//alert(document.getElementsByName(imgName)[0].src);
	}
	function MM_swapImageOnMouseOut(imgName)
	{
		document.getElementsByName(imgName)[0].src = '../images/' + imgName + '.gif';
	}
	
	function MM_swapImageOnMouseOver_Index(imgName)
	{
		document.getElementsByName(imgName)[0].src = './images/' + imgName + '_s.gif';
		//alert(document.getElementsByName(imgName)[0].src);
	}
	function MM_swapImageOnMouseOut_Index(imgName)
	{
		document.getElementsByName(imgName)[0].src = './images/' + imgName + '.gif';
	}

/* ******************** tsim - images button gif********************** */
	function MM_swapImageOnMouseOver_tsim(imgName)
	{
		document.getElementsByName(imgName)[0].src = '../images/' + imgName + '_s.jpg';
		//alert(document.getElementsByName(imgName)[0].src);
	}
	function MM_swapImageOnMouseOut_tsim(imgName)
	{
		document.getElementsByName(imgName)[0].src = '../images/' + imgName + '.jpg';
	}

	function MM_swapImageOnMouseOver_Index_tsim(imgName)
	{
		document.getElementsByName(imgName)[0].src = './images/' + imgName + '_s.jpg';
		//alert(document.getElementsByName(imgName)[0].src);
	}
	function MM_swapImageOnMouseOut_Index_tsim(imgName)
	{
		document.getElementsByName(imgName)[0].src = './images/' + imgName + '.jpg';
	}

