<!--

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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

	function getClientWidth(){
		var width	=	0;
		var ifclause	=	0;
		if( document.documentElement && document.documentElement.clientWidth ) {
			width	=	document.documentElement.clientWidth;
			ifclause	=	1;
		}
		else if( parent.document.body && parent.document.body.clientWidth ) {
			width	=	parent.document.body.clientWidth;
			ifclause	=	2;
		}
		else if( document.body && document.body.clientWidth ) {
			width	=	document.body.clientWidth;
			ifclause	=	3;
		}
		else if( window.innerWidth ) {
			width	=	window.innerWidth - 18;
			ifclause	=	4;
		}
		//alert('ifclause: '+ifclause+' width: '+width);
		return width;
	};
	
	function getClientHeight() {
		var height	=	0;
		var ifclause	=	0;
		if( document.documentElement && document.documentElement.clientHeight ) {
			height	=	document.documentElement.clientHeight;
			ifclause	=	1;
		}
		else if( parent.document.body && parent.document.body.clientHeight ) {
			height	=	parent.document.body.clientHeight;
			ifclause	=	2;
		}
		else if( document.body && document.body.clientHeight ) {
			height	=	document.body.clientHeight;
			ifclause	=	3;
		}
		else if( window.innerHeight ) {
			height	=	window.innerHeight - 18;
			ifclause	=	4;
		}
		//alert('ifclause: '+ifclause+' height: '+height);
		return height;
	}
	
	function resize_window(w,h) {
		setClientWidth = w;
		setClientHeight = h;
		window.resizeTo(w, h);
		//var thisClientWidth = window.document.body.clientWidth;
		//var thisClientHeight = window.document.body.clientHeight;
		var thisClientWidth = getClientWidth();
		var thisClientHeight = getClientHeight();
		if (thisClientWidth < w)
			var setClientWidth = w + (w - thisClientWidth);
		if (thisClientHeight < w)
			var setClientHeight = h + (h - thisClientHeight);
		
		//alert('setClientWidth: ' + setClientWidth + ' ' + 'setClientHeight: ' + setClientHeight);
		window.resizeTo(setClientWidth, setClientHeight);
	}
	
	function resize_window_according_to_document() {
	  w = getClientWidth();
	  h = getClientHeight();
	  resize_window(w,h);
	}
	
	
	var popUpWinURLOnly=0;
	function popUpWindowURLOnly(URLStr)
	{
		if(popUpWinURLOnly)
		{
			if(!popUpWinURLOnly.closed) popUpWinURLOnly.close();
		}
		popUpWinURLOnly = window.open(URLStr, 'popUpWinURLOnly', '');
		if (popUpWinURLOnly.opener == null)
			popUpWinURLOnly.opener	=	self;
		popUpWinURLOnly.focus();
	}
	
	function popUpWindowURLOnlyOnLoad(URLStr)
	{
		popUpWindowURLOnly(URLStr);
	}
	
	
	
	var popUpWin=0;
	function popUpWindow(URLStr, left, top, width, height)
	{
	  if(popUpWin)
	  {
		if(!popUpWin.closed) popUpWin.close();
	  }
	  popUpWin	=	open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	  popUpWin.focus();
	}
	
	var popUpWinWH=0;
	function popUpWindowWH(URLStr, w, h)
	{
		if(popUpWinWH)
		{
			if(!popUpWinWH.closed) popUpWinWH.close();
		}
		var xsize	=	w;
		var ysize	=	h;
		var DocumentWidth	=	parseInt(getClientWidth());
		var DocumentHeight	=	parseInt(getClientHeight());
		var xpos	=	(DocumentWidth/2)-(xsize/2);
		var ypos	=	(DocumentHeight/2)-(ysize/2);
		//alert('xpos: '+xpos+' ypos: '+ypos);
		
		popUpWinWH	=	open(URLStr, 'popUpWinWH', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes, width='+xsize+',height='+ysize+',left='+xpos+',top='+ypos);
		if (popUpWinWH.opener == null)
			popUpWinWH.opener	=	self;
		popUpWinWH.focus();
	}
	
	var popUpWinWHScroll=0;
	// Note: function name should be diffrent then the variable name
	function popUpWindowWHScroll(URLStr, w, h)
	{
		if(popUpWinWHScroll)
		{
			if(!popUpWinWHScroll.closed) popUpWinWHScroll.close();
		}
		var xsize	=	w;
		var ysize	=	h;
		var DocumentWidth	=	parseInt(getClientWidth());
		var DocumentHeight	=	parseInt(getClientHeight());
		var xpos	=	(DocumentWidth/2)-(xsize/2);
		var ypos	=	(DocumentHeight/2)-(ysize/2);
		//alert('xpos: '+xpos+' ypos: '+ypos);
		
		popUpWinWHScroll	=	open(URLStr, 'popUpWinWHScroll', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes, width='+xsize+',height='+ysize+',left='+xpos+',top='+ypos);
		if (popUpWinWHScroll.opener == null)
			popUpWinWHScroll.opener	=	self;
		popUpWinWHScroll.focus();
	}
	
	function openCenteredPopup(anchor,w,h,name,params)	{	//{{{
		sw=screen.availWidth;
		sh=screen.availHeight;
		//alert('w: ' + w + ' h: ' + h);
		if(( w == 0 ) || ( h == 0 )) {
			win = window.open(anchor,name,"width="+sw+",height="+sh+",top="+0+",left="+0+","+params);
		} else if(( w != '' ) || ( h != '' )) {
			win = window.open(anchor,name,"width="+w+",height="+h+","+params);
		} else{
			xpos=(sw-w)/2;
			ypos=(sh-h)/2;
			win=window.open(anchor,name,'type=fullWindow,fullscreen,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=no');
		}
		win.focus();
	}
	
	

	function popupLCD(dashgroup) {
		var w=980;
		var h=550;
		var left = (screen.width/2)-(w/2);
		var top = (screen.height/2)-(h/2);
		var lcdpopuppage;
	
		switch(dashgroup) {
			case "1": lcdpopuppage = "lcd-1.htm"; break;
			case "2": lcdpopuppage = "lcd-2.htm"; break;
			case "3": lcdpopuppage = "lcd-3.htm"; break;
			case "4": lcdpopuppage = "lcd-4.htm"; break;
			case "5": lcdpopuppage = "lcd-5.htm"; break; 
		}
	
		var win = window.open('/lcd/'+lcdpopuppage+'','','status=no, menubar=no, resizable=no, scrollbars=no, toolbar=no, location=no, directories=no, width='+w+', height='+h+', top='+top+', left='+left);
	
	} 
//-->
