window.defaultStatus = "Bargelink";

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_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_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 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) 
{ //v3.0
  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); 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 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_openBrWindow(theURL,winName,features) 
{ //v2.0
 window.open(theURL,winName,features);
}

function popUpHelp(url) {

	props=window.open(url, "Help",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,maximize=no,width=500,height=300');
	props.focus();
	return;
}

function padout(number) 
{ 
	return (number < 10) ? '0' + number : number; 
}
function updateTime() 
{
	imgName= 'TimeImage';
	CETServerTime.setTime(CETServerTime.getTime() + 1000);
	if (window.document.all && window.document.all['clockTime'])
	{
		window.document.all['clockTime'].innerText = padout(CETServerTime.getHours()) + ':' + padout(CETServerTime.getMinutes()) + ':' + padout(CETServerTime.getSeconds());	
		setTimeout('updateTime()',1000);
	}
	else
	{
		if(document.getElementById && document.getElementById("clockTime"))
		{
			document.getElementById("clockTime").innerHTML = padout(CETServerTime.getHours()) + ':' + padout(CETServerTime.getMinutes()) + ':' + padout(CETServerTime.getSeconds());	
			setTimeout('updateTime()',1000);	
		}
		else
		{
			if(window.document.layers && window.document[imgName])
			{
				var img = window.document[imgName];
			 	if (!img.maps)
					l = img.maps = new Layer (75);
			 	if (img.maps) 
			  	{
					l.document.open();
			    	l.document.write('<font class="date">'+padout(CETServerTime.getHours()) + ':' + padout(CETServerTime.getMinutes()) + ':' + padout(CETServerTime.getSeconds())+'</font>');
			    	l.document.close();
			    	//l.clip.width = img.width; l.clip.height = img.height;
			    	l.left = img.x+1; l.top = img.y+17;
			  	}
			  	img.maps.visibility = 'show';
				setTimeout('updateTime()',1000);
			}
		}
  	}
 }
 
 function GetImageXfromLeft(imgID) 
{
  if (HM_NS4) 
  	return eval(imgID).x
  else 
  	return GetRealLeft(imgID);
}

function GetImageYfromTop(imgID) 
{
  if (HM_NS4) 
  	return eval(imgID).y
  else 
  	return GetRealTop(imgID);
}

function GetRealLeft(imgElem) 
{
	xPos = eval(imgElem).offsetLeft;
	tempEl = eval(imgElem).offsetParent;
  	while (tempEl != null) 
	{
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
	return xPos;
}

function GetRealTop(imgElem) 
{
	yPos = eval(imgElem).offsetTop;
	tempEl = eval(imgElem).offsetParent;
	while (tempEl != null) 
	{
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
	return yPos;
}

function SetWindowStatus(Status)
{
	if(Status)
	{
		window.status=Status;
	}
	else
	{
		window.status='Bargelink';
	}
	return true;
}

function padDigit(digit){ 
  	if(digit<10) return "0"+digit; 
  	else return digit; 
} 

function dateAdd(baseStr,days){ 
  	baseTime = baseStr.split("-"); 
  	time = new Date(baseTime[2],(baseTime[1]-1),baseTime[0]); 
  	time = new Date(time.valueOf()+days*1000*3600*24); 
  	return padDigit(time.getDate())+"-"+padDigit((time.getMonth()+1))+"-"+time.getYear(); 
}