//    IMAGE PRELOAD
var imgArray = new Array();
function imgPreload() {
  if (!document.images) return;
  for (var i = 0; i < imgPreload.arguments.length; i++) {
     imgArray[i] = new Image();
     imgArray[i].src = imgPreload.arguments[i];
  }
}
//
// IMAGE POPUP WINDOW ROUTINE
function openImage(imageName,imageWidth,imageHeight,alt,title) {
newWindow = window.open("","newWin","width="+imageWidth+",height="+imageHeight);
newWindow.document.open();
newWindow.document.write('\<html\>\<title\>'+title+'\<\/title\>\<body bgcolor="\#663300" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()"\>');
newWindow.document.write('\<a href=\"#\" onClick=\"window.close()\"\>\<img border="0" src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+' \/\>\<\/a\>');
newWindow.document.write('\</body\>\</html\>');
newWindow.document.close();
newWindow.focus();}
//
// WINDOW OPEN
function newWin(url,scrlbr,wdth,hght,tp,lft) {
 window.open(url, "newWindow", "scrollbars=" +scrlbr+ ",width=" +wdth+ ",height=" +hght+ ",top=" +tp+ ",left=" +lft)
}
//    WINDOW CLOSE
function closeWindow()
{
	window.close();
}

//    IMAGE ROTATION
// call imgRotate object by naming an image tag appropriately
// [<img name="imgRotate" src="images/banner.gif"...>]
// and sourcing the first image in the array with an onLoad call:
// rotate()in body tag.
var rotImg = new Array("http://www.tika.net/images/tika_bnnr01.gif","http://www.tika.net/images/tika_bnnr02.gif","http://www.tika.net/images/tika_bnnr03.gif")
thisImg = 0
countr = rotImg.length
function rotate() {
  if (document.images) {
   thisImg++
    if (thisImg == countr) {
     thisImg = 0
    }
  document.imgRotate.src=rotImg[thisImg]
  setTimeout("rotate()", 2 * 1500)
  }
}

// OPEN WHOIS
function openWhois()
{
window.open("php/whois2/whois.phtml","","resizable=no,scrollbars=no,width=600,height=270,top=10,left=10");
}

// ONFOCUS AND ONBLUR FUNCTIONS FOR FORM FIELD VALUE ECHOING
//  onfocus="forerule1(this);" onblur="formrule2(this);" value="somevalue"
function formrule1(field)
{
if (field.defaultValue == field.value) field.value = "";
}
function formrule2(field) {
  if (field.value == "") {
    field.value = field.defaultValue;
  }
}

// Expand-Contract Paragraph
function expCon(a){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block"
  } else {
    e.style.display="none"
  }
  return true;
}

// onChange selection jump-to link [onChange="jump(this)" -- in SELECT tag]
function jump(menu){
  var loc = menu[menu.selectedIndex].value.split("~");
  location.reload(true);
  if(loc.length == 2) {
    attribs="width=700,height=615,scrollbars=1,menubar=0,top=0,left=0";
    window.open(loc[1], loc[0], attribs);
  }
}

