function imgChange( oImg, sImg )
{
	oImg.src = sImg;
	oImg.style.cursor="pointer"; 
}	

function bgChange( sTable, sImg )
{	var oTable = document.getElementById(sTable);
	
	oTable.style.backgroundImage = "url(" + sImg+ ")";
	//oTable.style.cursor="pointer"; 
}	
function fnRedirect( sUrl, sTarget, sPage, iMenu1Id )
{	
		document.location.href = sUrl;
}

function setLocation(sPage)
{
	document.location.href = sPage;
}

function PreloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=PreloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function GetParameter(sParam){
	var sPage=document.location+"";
	if(sPage.indexOf('?')!=-1){
		var sParams=sPage.split('?')[1];
		var vParams=sParams.split('&');
		for (i=0;i<vParams.length;i++){
			var vParam= vParams[i].split('=');
			if(vParam[0]==sParam) return vParam[1];
		}
	}
	return null;
}
		
function GetParameter2(objDocument,sParam){
	var sPage=objDocument.location+"";
	var sParams=sPage.split('?')[1];
	var vParams=sParams.split('&');
	for (i=0;i<vParams.length;i++){
		var vParam= vParams[i].split('=');
		if(vParam[0]==sParam) return vParam[1];
	}
	return null;
}
		
function OpenCenteredPopup(page,title,width,height,options,fixed)
{
	//correct size for the popup
	var popupWidth;
	var popupHeight;
	var popupTop;
	var popupLeft;
	
	if (fixed=='yes') {

		if (width==0)
			popupWidth = screen.width - 100;
		else
			popupWidth = width;
		if (height==0)
			popupHeight = screen.height - 100;
		else
			popupHeight = height;

	} else {

		if (width==0)
			popupWidth = screen.width - 100;
		else
			popupWidth = screen.width * width / 800
		if (height==0)
			popupHeight = screen.height - 100;
		else
			popupHeight = screen.height * height / 600

	}

	//center the popup
	var screenX;
	var screenY;
	
	screenY = screen.availHeight;
	screenX = screen.availWidth;
	
	popupLeft = (screenX - popupWidth) / 2;
	popupTop = (screenY - popupHeight) / 2;
	if (navigator.appName.indexOf("Microsoft")<0) {
		popupLeft = (popupLeft - pageXOffset);
		popupTop = (popupTop - pageYOffset);
	}
	if (popupTop<0) popupTop=0;
	if (popupLeft<0) popupLeft=0;
		
	//opens the popup
	if (navigator.appName.indexOf("Microsoft")>=0) 
	{
		if (options != '') options+=',';
		options+='width='+popupWidth+',height='+popupHeight+',left='+ popupLeft +',top='+popupTop;
	}
	else
	{
		if (options != '') options+=',';
		options+='width='+popupWidth+',height='+popupHeight+',screenX='+ popupLeft +',screenY='+popupTop;
	}
	var floater=window.open(page,title,options);
	floater.focus();
	return floater;
}
function removeQuotes(sText)
{
	var sText1 = sText.replace(/\n/g,"<br>"); 
	return sText1;
}











