/********************************************************************************
Copyright (C) 1999 Thomas Brattli
This script is made by and copyrighted to Thomas Brattli at www.bratta.com
Visit for more great scripts. This may be used freely as long as this msg is intact!
I will also appriciate any links you could give me.
********************************************************************************/
//Default browsercheck, added to all scripts!
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()
//With nested layers for netscape, this function hides the layer if it's visible and visa versa
function showHide(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
	if(obj.visibility=='visible' || obj.visibility=='show') obj.visibility='hidden'
	else obj.visibility='visible'
}
//Shows the div
function show(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
	obj.visibility='visible'
	obj.style.display="block";
}
//Hides the div
function hide(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
	obj.visibility='hidden'
	obj.style.display='none'
}

 var currDivObj = null;
 function changeDIV(selObj) {
   var divobj;
   if (document.getElementById)
      divobj = document.getElementById(selObj);
   else if (document.all)
      divobj = document.all(selObj);
   else if (document.layers)
      divobj = document.layers[selObj];

   if(document.getElementById || document.all){
      if(currDivObj){
         currDivObj.style.display = "none";
      }
      divobj.style.display = "block";
      }
      else if (document.layers) {
         if(currDivObj){
            currDivObj.visibility = "hidden";
         }
      divobj.visibility = "visible";
      }
      currDivObj = divobj;      
 }
 
var currDivObj2 = null;
 function changeDIV2(selObj) {
      var divObj;
      selValue = selObj.options[selObj.selectedIndex].value;
      document.cookie="sel1="+selObj.selectedIndex
      if (document.getElementById)
         divObj = document.getElementById("div" + selValue);
      else if(document.all)
           divObj = document.all("div" + selValue);
      else if (document.layers)
           divObj = document.layers["div" + selValue];

      if(document.getElementById || document.all){
           if(currDivObj2){
                currDivObj2.style.display = "none";
           }
           divObj.style.display = "block";
      }
      else if (document.layers) {
           if(currDivObj2){
                currDivObj2.visibility = "hidden";
           }
           divObj.visibility = "visible";
      }
      currDivObj2 = divObj;
   }

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_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 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 goToURL(url,New) {
   if (url != "#") {
      if (New == 1) {
         window.open(url,"");
      }
      else {
         self.location = url;
      }
   }
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=400,left = 362,top = 184');");
}

function ThreadpopUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=450,height=500,left = 362,top = 184');");
}

function checkChoice(field, i) {
if (i == 0) { // "All" checkbox selected.
if (field[0].checked == true) {
for (i = 1; i < field.length; i++)
field[i].checked = false;
   }
}
else  {  // A checkbox other than "Any" selected.
if (field[i].checked == true) {
field[0].checked = false;
      }
   }
}

function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(form1.txtEmailAddy.value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}
