<!--
//************ Start Default Commands ************
var h = "hidden";
var v = "visible";
var db = "block";
var dn = "none";
var graphic = "";   
var isNS4 = 0; var isIE4 = 0; var isNS6 = 0; var isNew = 0;
var docObj, styleObj, currObj, cstyleObj;

var bVer = (parseInt(navigator.appVersion));
var bName = navigator.appName;
var brow = ((navigator.appName) + (parseInt(navigator.appVersion)));

if (bName == "Netscape" && bVer >= 3) version = "js";
else if (bName == "Microsoft Internet Explorer" && bVer >= 4) version = "js";
else if (bName == "Netscape" && bVer == 2) version = "no";
else if (bName == "Microsoft Internet Explorer" && bVer >= 2) version = "no";

if (parseInt(navigator.appVersion >= 5)){isNew = 1}
else if (brow == "Netscape4") {isNS4 = 1;}
else if (brow == "Netscape5") {isNS6 = 1;}
else if (brow == "Microsoft Internet Explorer4") {isIE4 = 1;}
				
if (isNS4||isNS6||isIE4||isNew) {
  if(isNS4){ docObj = "document."; }
  else if(isNS6){ docObj = "document.getElementById('"; }
  else { docObj = "document.all."; }

  if(isNS4){ styleObj = ""; }
  else if(isNS6){ styleObj = "').style"; }
  else { styleObj = ".style"; }
  
  if(isNS4){ cstyleObj = ""; }
  else if(isNS6){ cstyleObj = "').currentStyle"; }
  else { cstyleObj = ".currentStyle"; }
}

function getQuery(val){
  var querystring = location.search.substring(1,location.search.length);
  var o = "";
  var tSec = querystring.indexOf(val+"=");
  var tStr = querystring.substring( (tSec+(val.length+1)),querystring.length);
  
  if(tSec != -1){
    if(tStr.indexOf('&') != -1){
      o = tStr.substring(0,tStr.indexOf('&'));
    } else {
      o = tStr;
    }
  }
  return o;
}

function replaceSubstring(s,f,w){
  rtn = "";
  flg = 0;
  
  for(i = 0; i < s.length; i++){
    if(s.substr(i,f.length) == f){
      rtn += w;
      i += (f.length - 1);
    } else {
      rtn += s.charAt(i);
    }
  }
  
  return (rtn);
}

function writeFlash(fName,bg,w,h){
  if( (navigator.appName == "Netscape") && (parseInt(navigator.appVersion) <= 4) ){
    document.write('<embed src="' + fName + '" quality="high" bgcolor="#' + bg + '" WIDTH="' + w + '" HEIGHT="' + h + '" NAME="header" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" />');
  } else {
    document.write('<OBJECT data="' + fName + '" width="' + w + '" height="' + h + '" id="header" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" codetype="application/x-shockwave-flash">');
    document.write(' <PARAM NAME="movie" VALUE="' + fName + '" />');
    document.write(' <PARAM NAME="quality" VALUE="high" />');
    document.write(' <PARAM NAME="bgcolor" VALUE="#' + bg + '" />');
    document.write('<embed src="' + fName + '" quality="high" bgcolor="#' + bg + '" WIDTH="' + w + '" HEIGHT="' + h + '" NAME="header" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</OBJECT>');
  }
}

function openPopup(URL,id,width,height){
  window.open(URL, id, "toolbar=no,location=no,width="+width+",height="+height+",status=yes,scrollbars=yes,scrolling=yes,menubar=no,resizable=yes");
}

function openPopupLocked(URL,id,width,height){
  window.open(URL, id, "toolbar=no,location=no,width="+width+",height="+height+",status=yes,scrollbars=yes,scrolling=yes,menubar=no,resizable=no");
}

function goPage(u){
  location.href = u;
}

function layerChange(tmpLayer,tmpVisible) {
  if (isNS4||isNS6||isIE4||isNew) { eval(docObj + tmpLayer + styleObj + '.visibility = ' + tmpVisible) }
}

function displayChange(tmpLayer,tmpVisible) {
  if (isNS4||isNS6||isIE4||isNew) { eval(docObj + tmpLayer + styleObj + '.display = ' + tmpVisible) }
}

function rollover(graphic,state) {
  if(state==1){ if (version == "js") { document[graphic].src = "/graphics/" + graphic + "_dn.gif" } }
  if(state==0){ if (version == "js") { document[graphic].src = "/graphics/" + graphic + "_up.gif" } }
}

function imageover(graphic,filename) {
  if (version == "js") { document[graphic].src = "/graphics/" + filename }
}

function inputover(graphic,state) {
  if(state==1){ if (version == "js") { document.getElementById(graphic).src = "/graphics/" + graphic + "_dn.gif" } }
  if(state==0){ if (version == "js") { document.getElementById(graphic).src = "/graphics/" + graphic + "_up.gif" } }
}

function clearText(f,t,d){
  if(d == ""){ d = 0; }
  var doc = document.forms[d];
  var ele = doc.elements[f].value;

  if(ele == t){
    doc.elements[f].value = "";
  }
}

//************ End Default Commands ************
function random_num(k){
  return( Math.floor(k*Math.random()) );
} 

function loadHomepage(){
  var imgs = Array('/images/home_01.jpg','/images/home_02.jpg','/images/home_03.jpg','/images/home_04.jpg','/images/home_05.jpg','/images/home_06.jpg','/images/home_07.jpg','/images/home_08.jpg','/images/home_09.jpg','/images/home_10.jpg','/images/home_11.jpg','/images/home_12.jpg');
  var tot = imgs.length;
  var num = Array();

  num[0] = random_num(tot); num[1] = random_num(tot); num[2] = random_num(tot);
  while( (num[1] == num[0]) || (num[1] == num[2]) ){ num[1] = random_num(tot); }
  while( (num[2] == num[1]) || (num[2] == num[0]) ){ num[2] = random_num(tot); }

  document['home_01'].src = imgs[num[0]];
  document['home_02'].src = imgs[num[1]];
  document['home_03'].src = imgs[num[2]];
}

function updateImage(val,len,fol,fil){
  var count = (document.forms[0].fieldImage.value)*1;
  var imgStart = count + val;
  if(fil != ""){ tmpVal = "_"; } else { tmpVal = ""; }

  if(imgStart > len){ imgStart = 1; } else if(imgStart < -1){ imgStart = len+imgStart; }
  document.images["img_01"].src = "/images/" + fol + "/" + fil + tmpVal + imgStart + ".jpg";
  document.images["img_02"].src = "/images/" + fol + "/" + fil + tmpVal + (imgStart+1) + ".jpg";
  document.images["img_03"].src = "/images/" + fol + "/" + fil + tmpVal + (imgStart+2) + ".jpg";
  document.forms[0].fieldImage.value = imgStart
}

//-->