function RedirectUrl(sURL){

	if (window.parent.opener != null){
		window.parent.opener.location=sURL;
	} else {
		window.location.href=sURL;
	}
}

function SwitchImg()
{ //start
  var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
    for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
    	store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
    if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
        (store.indexOf('document.all[')==0 && document.all==null))
         store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
         obj = eval(store);
    if (obj != null) {
   	   switcher[keep++] = obj;
      switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
      obj.src = SwitchImg.arguments[rem+2];
  } }
  document.Data = switcher;
} //end

function RestoreImg()
{ //start
  if (document.Data != null)
    for (var rem=0; rem<(document.Data.length-1); rem+=2)
      document.Data[rem].src=document.Data[rem+1];
} //end

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



//** void focusform()
//**  Sets the focus on the first element on the first form of the page
//**  Author: Jani Kemppainen 11/11/2003

function focusform()  {	
	if (document.forms)  {
		Form = document.forms[document.forms.length-1];
		if (Form)  {
			if (Form.length > 0)  {
				for (i = 0 ; i < Form.length ; i++)  {					
					if (Form.elements[i].type == "text" || Form.elements[i].type == "textarea")  {						
						Form.elements[i].focus();
						break;
					}
				}
			}	
		}
	}
}

//** Functions required for the help layer
//** 
var iTimeoutID = null;			// Handler for the timeout which hides and displays the layer
var bInitialized = false;		// True if the layers has been initialized (set at first call)

var _nav4 = ((navigator.appName.indexOf("Netscape") != -1) && (parseFloat(navigator.appVersion) <= parseFloat(4.9)));

	
//** displayHelp()
//**  - Displays the help layer (sets layer visibility to true)

function displayHelp() {
	if (!_nav4)
	{
		if (document.layers)  {
			document.helpns.visibility = "show";
		} else {
			pLayer = document.getElementById("help");
			if (pLayer)  {
				pLayer.style.visibility = "visible";
			}
		}
		iTimeoutID = null;
	}
}


//** hideHelp()
//**  - Hides the help layer (sets layer visibility to false)

function hideHelp() 
{
	if (!_nav4)
	{
		if (document.layers)  
		{
			document.helpns.visibility = "hide";
		} 
		else 
		{
			if (document.getElementById)  
			{
				pLayer = document.getElementById("help");
			} 
			else 
			{
				pLayer = document.all['help'];
			}
			if (pLayer)  
			{
				pLayer.style.visibility = "hidden";
			}
		}
		iTimeoutID = null;
	} 
}

//** setHelp()
//**  - Sets the help text, initizalises layer at first call

function setHelp(pEvent, sText, Object)  {
	if (!_nav4)
	{
		if (document.layers)  
		{
			pLayer = document.layers['helpns'];
			document.helpns.document.open();
			document.helpns.document.write(sText);
			document.helpns.document.close();
			document.helpns.moveTo(Object.x,Object.y + 16);								
		} 
		else 
		{
			iX = 0 ;
			iY = 0 ;
			iX = pEvent.clientX + document.body.scrollLeft;
			iY = pEvent.clientY + document.body.scrollTop;			

//** 			iX =  document.body.scrollLeft;
//**			iY =  document.body.scrollTop;			
		

			
			if (document.getElementById)  
			{
				pLayer = document.getElementById("help");
			} else 
			{
				pLayer = document.all['help'];
			}
			
			if (pLayer)  
			{
				pLayer.innerHTML = sText;
			 	pLayer.style.top = iY;
				pLayer.style.left = iX;
			} 
		}
		if (iTimeoutID != null)  
		{
			clearTimeout(iTimeoutID);
		}
		iTimeoutID = setTimeout("displayHelp()",300);
	}
}

//** unsetHelp()
//**  - Starts to hide the help layer (at 1/3 of sec.)
function unsetHelp()  {
	if (!_nav4)
	{
		if (iTimeoutID != null) 
		{
			clearTimeout(iTimeoutID);
		}
		iTimeoutID = setTimeout("hideHelp()",300);
	}
}


//** initHelp
//**  - Writes the help layer
function initHelp()  {	
	if (!_nav4)
	{
		if (bInitialized == false)
		{
		   	if (document.layers)  
			{
		   		document.write("<div charset=\"utf-8\" id=\"helpns\" class=\"help\" style=\"position: absolute; visibility: hidden\">&nbsp;</div>");	
		   	} 
			else 
			{
		   		//** Explorer code only, NS is created within the HTML cod
		   		document.write("<div charset=\"utf-8\" id=\"help\" class=\"help\" style=\"position: absolute; visibility: hidden\">&nbsp;</div>");	
	   		}
		   	bInitialized = true;
		}
	}

}

initHelp() ; 
