function getOffsetLeft(childElement,offsetLeft)
{	
	/*if (childElement.offsetParent == null)
		return(offsetLeft);
	else 
		return getOffsetLeft(childElement.offsetParent,offsetLeft+childElement.offsetLeft);*/
	return DL_GetElementLeft(childElement);
}
function getOffsetTop(childElement,offsetTop)
{	
	/*if (childElement.offsetParent == null)
		return(offsetTop);
	else 
		return getOffsetTop(childElement.offsetParent,offsetTop+childElement.offsetTop);*/
	return DL_GetElementTop(childElement);
}

function DL_GetElementLeft(eElement)
{
    if (!eElement && this)                      
    {                                            
        eElement = this;                         
    }                                            
    
    var nLeftPos = eElement.offsetLeft;          
    var eParElement = eElement.offsetParent;     
    while (eParElement != null)
    {                                            
        nLeftPos += eParElement.offsetLeft;      
        eParElement = eParElement.offsetParent;  
    }
    return nLeftPos;                            
}


function DL_GetElementTop(eElement)
{
    if (!eElement && this)
    {
        eElement = this;
    }

    var nTopPos = eElement.offsetTop;
    var eParElement = eElement.offsetParent;
    while (eParElement != null)
    {
        nTopPos += eParElement.offsetTop;
        eParElement = eParElement.offsetParent;
    }
    return nTopPos;
}

function browserCheck() {
	var agt=navigator.userAgent.toLowerCase();
  	var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
    this.nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1));
    this.nav2 = (this.nav && (is_major == 2));
    this.nav3 = (this.nav && (is_major == 3));
    this.ns4 = (this.nav && (is_major == 4));
    this.ns4up = (this.nav && (is_major >= 4));
    this.nsonly      = (this.nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    this.ns5 = (this.nav && (is_major == 5));
    this.ns5up = (this.nav && (is_major >= 5));
    this.ns6 = (this.nav && (is_major == 5) && (agt.indexOf("netscape")!=-1) && (agt.indexOf("6.")!=-1));
    this.ns6up = (this.nav && (is_major >= 5) && (agt.indexOf("netscape")!=-1) && (agt.indexOf("6.")!=-1));
    this.ns7 = (this.nav && (is_major == 5) && (agt.indexOf("netscape")!=-1) && (agt.indexOf("7.")!=-1));
    this.ns7up = (this.nav && (is_major >= 5) && (agt.indexOf("netscape")!=-1) && (agt.indexOf("7.")!=-1));
    this.ie   = (agt.indexOf("msie") != -1);
    this.ie3  = (this.ie && (is_major < 4));
    this.ie4  = (this.ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
    this.ie4up  = (this.ie  && (is_major >= 4));
    this.ie5  = (this.ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    this.ie5up  = (this.ie  && !this.ie3 && !this.ie4);
    this.ie6  = (this.ie && (is_major == 4) && (agt.indexOf("msie 6.0")!=-1) );
    this.ie6up  = (this.ie  && !this.ie3 && !this.ie4 && !this.ie5);
    this.aol   = (agt.indexOf("aol") != -1);
    this.aol3  = (this.aol && this.ie3);
    this.aol4  = (this.aol && this.ie4);
    this.opera = (agt.indexOf("opera") != -1);
    this.webtv = (agt.indexOf("webtv") != -1);

	this.win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
	this.mac   = (agt.indexOf("mac")!=-1);

}
is = new browserCheck();

var Obj;

function getObjectName(nameOfObject){

	Obj = null;

	if (is.ie4||is.ie4up||is.ie5||is.ie5up||is.ie6||is.ie6up) Obj = document.all[nameOfObject]
	else if (is.ns5||is.ns5up||is.ns6||is.ns6up) Obj = document.getElementsByTagName("*")[nameOfObject];
	else if (is.ns4||is.ns4up||is.ns4only) findLayer(window,nameOfObject);

	//if (!Obj || ( is.ns4 && Obj == window ) ) Obj = "Object not found";

	return Obj;
}

function findLayer(node,nameOfObject) {
	
	if ( node.id == nameOfObject||node.name == nameOfObject ) {Obj = node; Obj.style = node;};
	
	for ( var counter = 0; counter < node.document.images.length; counter++ ) {
		if (node.document.images[counter].id==nameOfObject||node.document.images[counter].name==nameOfObject) { Obj = node.document.images[counter]; Obj.style = node.document.images[counter]; }
	}

	for ( var counter = 0; counter < node.document.forms.length; counter++ ) {
		for ( var i = 0; i < node.document.forms[counter].elements.length; i++ ) {
			if (node.document.forms[counter].elements[i].id==nameOfObject||node.document.forms[counter].elements[i].name==nameOfObject) Obj = node.document.forms[counter].elements[i];
		}
	}
		
	for ( var i = 0; i < node.document.layers.length; i++ ) {
		findLayer(node.document.layers[i],nameOfObject);
	}
}

/*	var LocationStr = window.location.href;
	function tellerror(msg, url, line){
	window.alert('msg: '+msg+', url: '+url+', line: '+line);
	if (LocationStr.indexOf("?") == -1){
		window.location.href = window.location.href+'?errormsg='+escape(msg)+'&errorurl='+escape(url)+'&errorline='+escape(line);}
	else{
		window.location.href = window.location.href+'&errormsg='+escape(msg)+'&errorurl='+escape(url)+'&errorline='+escape(line);}
	return false;
	}
window.onerror=tellerror;*/

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_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}

function changeImages() {
  if (document.images ) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
    }
  }
}