var screenx=768;
var screeny=1024;
if (window.screen){
	screenx = screen.availHeight
	screeny = screen.availWidth
	}
function getdocsize(){
//	docwidth=screeny;
//	docheight=screenx;
	var de = document.documentElement;
	var docwidth = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth || screeny;
	var docheight = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight || screenx;
//	if(document.documentElement.offsetWidth){
//		docwidth = document.documentElement.offsetWidth;
//		docheight = document.documentElement.offsetHeight;
//		}
	return [docwidth,docheight];
	}
function SmallWindow(theURL,winName,features,width,height){
	if(features==null || typeof(features)=="undefined"){
		var oWin = window.open(theURL);
		}
	else{
		var top = screenx/2-height/2
		var left = screeny/2 - width/2
		var winsize ='width='+width+',height='+height+',top='+top+',left='+left+'';
		var oWin = window.open(theURL,winName,features+','+winsize);
		}
	if (oWin==null || typeof(oWin)=="undefined") alert("This popup was blocked. Please allow popups by selecting this option from your Tools menu and/or Anti Virus software.");
	}
/* hides <select> and <applet> objects (for IE only) */
function hideElm( elmID, overDiv ){
      if(/MSIE (5|6)/.test(navigator.userAgent)){
        for( i = 0; i < document.all.tags( elmID ).length; i++ ){
          obj = document.all.tags( elmID )[i];
          if( !obj || !obj.offsetParent ){continue;}

          // Find the element's offsetTop and offsetLeft relative to the BODY tag.
          objPos    = findPos(obj);
          overDivPos = findPos(overDiv);
          if(( overDivPos[0] + overDiv.offsetWidth ) <= objPos[0] );
          else if(( overDivPos[1] + overDiv.offsetHeight ) <= objPos[1] );
          else if( overDivPos[1] >= ( objPos[1] + obj.offsetHeight ));
          else if( overDivPos[0] >= ( objPos[0] + obj.offsetWidth ));
          else{obj.style.visibility = "hidden";}
        }
      }
    }
/* unhides <select> and <applet> objects (for IE only)  */
function showElm( elmID ){
      if(/MSIE (5|6)/.test(navigator.userAgent)){
        for( i = 0; i < document.all.tags( elmID ).length; i++ ){
          obj = document.all.tags( elmID )[i];
          
          if( !obj || !obj.offsetParent ){continue;}
        
          obj.style.visibility = "";
        }
      }
    }

function visibility(type,id){
	if (document.getElementById){
		x = document.getElementById(id);
		x.style.visibility = type;
		}
	else if (document.all){
		x = document.all[id];
		x.style.visibility = type;
		}
	}
function zIndex(index,id){
	if (document.getElementById){
		x = document.getElementById(id);
		x.style.zIndex = index;
		}
	else if (document.all){
		x = document.all[id];
		x.style.zIndex = index;
		}
	}
function writeDIV(text,id){
	if (document.getElementById){
		x = document.getElementById(id);
		x.innerHTML = text;
		}
	else if (document.all){
		x = document.all[id];
		x.innerHTML = text;
		}
	else if (document.layers){
		x = document.layers[id];
		x.document.open();
		x.document.write(text);
		x.document.close();
		}
	}
function findPos(x){
	var curleft = curtop = 0;
	if (x.offsetParent) {
		curleft = x.offsetLeft
		curtop = x.offsetTop
		while (x = x.offsetParent) {
			curleft += x.offsetLeft
			curtop += x.offsetTop
			}
		}
	return [curleft,curtop];
	}
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_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_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();
}
function ChangeStyle(objName, style){
  obj = MM_findObj(objName);
  if (obj.style){
    obj.style.cssText = style;
  }
}
if (!String.prototype.lTrim){String.prototype.lTrim=function(){return this.replace(/^\s*/,'');}}
if (!String.prototype.rTrim){String.prototype.rTrim=function(){return this.replace(/\s*$/,'');}}
if (!String.prototype.Trim){String.prototype.Trim=function(){return this.lTrim().rTrim();}}
function setCookie(name, value) {
	var expires = new Date();
	expires.setTime(expires.getTime() + 3E11);   // about 10 years = "forever"
	if (name == "EMail")
		{
		if (VEmail(value))
			{
			document.cookie =  name + "=" + escape (value) + "; expires=" + expires.toGMTString() 
			}
		else
			{
			deleteCookie("EMail");
			}
		}
	else
		{
		document.cookie =  name + "=" + escape (value) + "; expires=" + expires.toGMTString() 
		}
	}
function deleteCookie(name) {
	document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT"
   }
function VEmail(add){
	if ((add.search(/[^\w@\._-]/)== -1)&&(add.length > 5)){
		var len = add.length
		var atpos = add.search(/@/)
		if (( atpos > 0)&& (atpos < len)){
			add = add.slice(atpos+1,len)
			if (add.search(/@/)!=-1){
				return false
				}
			len = add.length
			var dotpos = add.search(/\./)
			if (( dotpos > 1)&& (dotpos < len-2)){
				return true;
				}
			}
		}
	return false;
	}
function bookmarksite(title, url){
	if (document.all){
		window.external.AddFavorite(url, title);
		}
	else if (window.sidebar){
		window.sidebar.addPanel(title, url, "")
		}
	}
