
	//----------------------------------------- 
	//  BROWSER VERSION  
	//-----------------------------------------
	var IE = document.all; // IE 4x
	var NN = document.layers; //NN 4x
	var IENN = document.getElementById; // IE 5x and N6x
	var isN6 = false; //N6 true or false to make difrense betwen IE5 and N6..
	if (navigator.appName == 'Netscape') 
	{
  		if (navigator.appVersion.charAt(0) == "5")
  		{
			isN6 = true;// N6x
		}
	}	
			
	//-------------------------------------- 
	// PLATFORM 
	//--------------------------------------
	var agt = navigator.userAgent.toLowerCase(); // convert all characters to lowercase to simplify testing 
	var isWin = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
	var isMac = (agt.indexOf("mac")!=-1);
	
	var coll="";
	var styleObj="";
	
	//--------------------------- 
	// Layer Check
	//---------------------------
	if (IENN)
	{
		coll = "getElementById('";
		styleObj = "').style";
	}
	else if(IE)
	{
		coll = "all('";
		styleObj = "').style"
	}
	else if(NN)
	{
		coll = "layers['";
		styleObj = "']";
	}
	else
	{
		//document.location.href= strFile;
	}
	
	//-------------------------------------- 
	//Change picture in DIV
	//--------------------------------------
	function changePictInDiv(imgName,newImage,divName){
		if(IE||isN6){

		document.images[imgName].src = newImage;
		}
		if(NN){		

		document.layers[divName].document.images[imgName].src = newImage;
		}
	}
	
	//-------------------------------------- 
	//Change picture
	//--------------------------------------
	function changePict(imgName,newImage,intHeight){
	//alert(imgName)
		document.images[imgName].src = newImage;
		if(intHeight > 0){
		document.images[imgName].height = intHeight
	
		}
	}
	
	//--------------------------------------
	//Open browser window
	//--------------------------------------
	function openBrWindow(theURL,winName,features) { 
		window.open(theURL,winName,features);
	}
	
	
	
	/*
	-------------------------------------------------------------------------------
	function writeToLayer(strLayer, strText)
	-------------------------------------------------------------------------------
	Desc:	write content to the specific 
			layer works in IE 4x, IE5x, NN4x
			NN6x
	Arg:	strLayer = the name of the layer
			to write in.
			strText = the string to be writen
			to the layer
	Ret:	none.
	-------------------------------------------------------------------------------
	*/
	function writeToLayer(strLayer,strText)
	{
		if(IENN)
		{	
			document.getElementById(strLayer).innerHTML = strText;
		}
		else if(IE)
		{
			IE[strLayer].innerHTML = strText;
		}
		else if(document.layers)
		{
			//objRef = getObj(strLayer);
			document.layers[strLayer].document.open();
			document.layers[strLayer].document.write(strText);
			document.layers[strLayer].document.close();
		}
		else{
			
		}
	}

	
	
	/*-----------------------------------------
	function handleResize()
	-----------------------------------------
	Desc:	reload the page, specialy used to
			fix the resize bugg i NN   		
	Arg:	
	Ret:	false
	-----------------------------------------
	*/
	function handleResize()
	{
		document.location.reload();
		//return false
}
	
	/*
	-----------------------------------------
	function getObj(strLayer)
	-----------------------------------------
	Desc:	Return a object reference to 
			the layer. Works for IE 4x, IE5x,
			NN4x, NN6x  		
	Arg:	strLayer = the name of the layer.
	Ret:	Object Reference
	-----------------------------------------
	*/
	function getObj(strLayer)
	{
		var objRef;
		if(typeof strLayer == "string")
		{
			return objRef = eval("document." + coll  + strLayer  + styleObj);
		}
		else
		{
			return objRef = strLayer
		}
	}
	
	/*
	-----------------------------------------
	function hideLayer(strLayer)
	-----------------------------------------
	Desc:	hide the specific layer works in
			IE 4x, IE5x, NN4x, NN6x
	Arg:	strLayer = the name of the layer
			to hide.
	Ret:	none.
	-----------------------------------------
	*/
	function hideLayer(strLayer)
	{
		var objRef = getObj(strLayer);
		if(IE || IENN)
		{
			objRef.visibility = "hidden";
		}
		else if(document.layers)
		{
			objRef.visibility = "hide";
		}
	}
	/*
	-----------------------------------------
	function showLayer(strLayer)
	-----------------------------------------
	Desc:	show the specific layer works in
			IE 4x, IE5x, NN4x, NN6x
	Arg:	strLayer = the name of the layer
			to show.
	Ret:	none.
	-----------------------------------------
	*/
	function showLayer(strLayer)
	{
		var objRef = getObj(strLayer);
		
		if(document.layers)
		{
			objRef.visibility = "show";
			objRef.display = '';
		}
		else
		{
			objRef.visibility = "visible";
			objRef.display = '';
		}
}


function MM_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=MM_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 getObjHeight(strLayer)
-----------------------------------------
Desc:	gets the Height of the Layer
		IE 4x, IE5x, NN4x, NN6x
Arg:	strLayer = the name of the layer.
Ret:	integer (Height) in pixels
-----------------------------------------
*/
function getObjHeight(strLayer)
{
	var intHeight;
	if(IENN)
	{
		return intHeight = parseInt(document.getElementById(strLayer).offsetHeight);
	}
	else if(IE)
	{
		return intHeight = parseInt(document.all[strLayer].clientHeight);
	}
	else if(document.layers)
	{
		var objRef = getObj(strLayer);
		intHeight = parseInt(eval(objRef.clip.height));
		return intHeight 
	}
	
}

/*
-----------------------------------------
function getObjWidth(strLayer)
-----------------------------------------
Desc:	gets the Height of the Layer
		IE 4x, IE5x, NN4x, NN6x
Arg:	strLayer = the name of the layer.
Ret:	integer (Width) in pixels
-----------------------------------------
*/
function getObjWidth(strLayer)
{
	var intWidth;
	if(IENN)
	{
		return intWidth = parseInt(document.getElementById(strLayer).offsetWidth);
	}
	else if(IE)
	{
		return intWidth = parseInt(document.all[strLayer].clientWidth);
	}
	else if(document.layers)
	{
		return intWidth = parseInt(document.layers[strLayer].clip.width);
	}
}



/*
-----------------------------------------
function getWindowWidth()
-----------------------------------------
Desc:	Gets the Window Width
		IE 4x, IE5x, NN4x, NN6x
		Note: IE don have a property for 
		the window width so I had to take 
		the body width. This can do that 
		it is not the exakt pixels width
		in exploer.  
Arg:	
Ret:	integer: the WindowWidth
-----------------------------------------
*/
function getWindowWidth()
{
	if (document.layers)
	{
		return parseInt(window.innerWidth);
	}
	if (IE)
	{
		return parseInt(document.body.offsetWidth);
	}
	else if (IENN && isN6)
	{
		return parseInt(window.innerWidth);
	}
}

/*
-----------------------------------------
function getWindowHeight()
-----------------------------------------
Desc:	Gets the Windows Height
		IE 4x, IE5x, NN4x, NN6x
		Note: IE don have a property for 
		the window Height so I had to take 
		the body Height. This can do that 
		it is not the exakt pixels Height
		in exploer.  
Arg:	
Ret:	integer: the WindowHeight
-----------------------------------------
*/
function getWindowHeight()
{
	if (document.layers)
	{
		return parseInt(window.innerHeight);
	}
	if (IE)
	{
		return parseInt(document.body.offsetHeight);
	}
	else if (IENN && isN6)
	{
		return parseInt(window.innerHeight);
	}
}

/*
-----------------------------------------
function moveLayer(strLayer, intX, intY)
-----------------------------------------
Desc:	Move the specefic layer  x and y 
		pixels from the curent position. 
		Works for IE 4x, IE5x, NN4x, NN6x  		
Arg:	strLayer = the name of the layer.
		intX = pixels to move in x cordinate
		intY = pixels to move in y cordinate
Ret:	none
-----------------------------------------
*/
function moveLayer(strLayer, intX, intY)
{
	
	var objRef = getObj(strLayer);
	var intCurentY = getObjTop(strLayer);
	var intCurentX = getObjLeft(strLayer);
	objRef.top = intCurentY + intY;	
	objRef.left = intCurentX + intX;

}

function moveLayerVertical(strLayer, intY)
{
	var objRef = getObj(strLayer);
	var intCurentY = getObjTop(strLayer);
	objRef.top = intCurentY + intY;	

}

/*
-----------------------------------------
function moveLayerTo(strLayer, intX, intY)
-----------------------------------------
Desc:	Move the specefic layer to the 
		x and y cordinats. Works for 
		IE 4x, IE5x, NN4x, NN6x  		
Arg:	strLayer = the name of the layer.
		intX = pixels from left
		intY = pixels from top
Ret:	none
-----------------------------------------
*/
function moveLayerTo(strLayer, intX, intY)
{
	var objRef = getObj(strLayer);
	objRef.top = intY;
	objRef.left = intX;
}
/*
-----------------------------------------
function centerLayer(strLayer)
-----------------------------------------
Desc:	Center the specific layer
		IE 4x, IE5x, NN4x, NN6x
Arg:	strLayer = the name of the layer.
Ret:	none.
-----------------------------------------
*/
function centerLayer(strLayer)
{
	var intWindowWidth  = getWindowWidth();
	var intWindowHeight = getWindowHeight();
	var intLayerWidth   = getObjWidth(strLayer);
	var intLayerHeight  = getObjHeight(strLayer);
	var intX = (intWindowWidth/2)  - (intLayerWidth/2);
	var intY = (intWindowHeight/2) - (intLayerHeight/2);
	moveLayerTo(strLayer, intX, intY );
}

/*
-----------------------------------------
function getObjTop(strLayer)
-----------------------------------------
Desc:	get the position from top in 
		pixels. works in IE 4x, IE5x,
		NN4x, NN6x
		OBS! this attribute must in some
		browsers (IE5x and N6x) been set
		before you can read it. You can
		do this in to ways,
		set the left attribute in a init()
		function onLoad, or you have to  
		set the style attribute in the tag
		instead of setting it as a id in a 
		<style> tag.   		

Arg:	strLayer = the name of the layer.
Ret:	integer how many pixels from top
-----------------------------------------
*/
function getObjTop(strLayer)
{
	var objRef = getObj(strLayer);
	if (document.layers)
	{
		return objRef.top
	}
	else if(IENN)
	{
		return parseInt(objRef.top);
	}
	else if (IE)
	{
		return parseInt(objRef.pixelTop);
	}
}

/*
-----------------------------------------
function getObjLeft(strLayer)
-----------------------------------------
Desc:	get the position from left in 
		pixels. works in IE 4x, IE5x,
		NN4x, NN6x
		OBS! this attribute must in some
		browsers (IE5x and N6x) been set
		before you can read it. You can
		do this in to ways,
		set the left attribute in a init()
		function onLoad, or you have to  
		set the style attribute in the tag
		instead of setting it as a id in a 
		"style" tag.   		

Arg:	strLayer = the name of the layer.
Ret:	integer how many pixels from left
-----------------------------------------
*/
function getObjLeft(strLayer)
{
	var objRef = getObj(strLayer);
	if (document.layers)
	{
		return objRef.left;
	}
	else if (IENN)
	{
		return parseInt(objRef.left);
	}
	else if (IE)
	{
		return parseInt(objRef.pixelLeft);
	}
}


