
function setShipping() {
	document.frmCheckout.txtShippingFirstName.value = document.frmCheckout.txtBillingFirstName.value;
	document.frmCheckout.txtShippingLastName.value = document.frmCheckout.txtBillingLastName.value;
	document.frmCheckout.txtShippingPhone.value = document.frmCheckout.txtBillingPhone.value;
	document.frmCheckout.txtShippingEmail.value = document.frmCheckout.txtBillingEmail.value;
	document.frmCheckout.txtShippingAddress1.value = document.frmCheckout.txtBillingAddress1.value;
	document.frmCheckout.txtShippingAddress2.value = document.frmCheckout.txtBillingAddress2.value;
	document.frmCheckout.txtShippingSuite.value = document.frmCheckout.txtBillingSuite.value;
	document.frmCheckout.txtShippingCity.value = document.frmCheckout.txtBillingCity.value;
	document.frmCheckout.txtShippingState.value = document.frmCheckout.txtBillingState.value;
	document.frmCheckout.txtShippingZip.value = document.frmCheckout.txtBillingZip.value;
	document.frmCheckout.txtShippingCountry.value = document.frmCheckout.txtBillingCountry.value;	
}

function init() {
	border = (ns4)? document.borderDiv.document: (ie4)? document.all['borderDiv']: (ie5||ns5)? document.getElementById('borderDiv'): null;
	bordercss = (ns4)? document.borderDiv: border.style;
	//bordercss.display="block";	
}

function ShowImage (index,objImg ) {
	//alert(imgName.name);
	if ( document.images ) {
		document["defImage"].src = aryImages[index];// eval(imgName + ".src");

	}
}

function HideBorder(objImg) {
	objImg.border = 0;	
}
function ShowDefaultImg () {
	//alert("Default");
	if ( document.images ) {
		document["defImage"].src = defaultImg ;
	}
}

function showCatalogPhoto(photo){	
	var clientpic;
    ImageLarge = document.getElementById("photo");
	ImageLarge.innerHTML = "<img src=\"../images/catalog/product/"+photo+ "\" width=\"549\" height=\"348\" alt=\"\">";
}

function getObjByName(name,doc) {
  var o = 0;
  if(!doc) doc = document;
  if(doc[name]) o=doc[name];
  if(document.all && doc.all[name]) o=doc.all[name];
  if(o) {
    if(!o.getElementsByTagName) o.getElementsByTagName = getElementsArray;
    return o;
  }
  if(document.layers) {
    for(var i=0;i < doc.layers.length;i++){
      var lyrdoc = doc.layers[i].document;
      if(lyrdoc[name]) return lyrdoc[name];
      if(lyrdoc.layers.length > 0) {
        var o = getObjByName(name,lyrdoc);
        if(o) return o;
      }
    }
  }
  return 0;
}
if(!document.getElementById) document.getElementById = getObjByName;

function getElementsArray(el) {
  if(document.layers) {
    var doc = (this == document) ? document : this.document;
    switch(el) {
      case 'img' : return doc.images;
      case 'a' : return doc.links;
      case 'div' : return doc.layers;
      case 'form' : return doc.forms;
      default : return 0;
    }
  }
  if(document.all) return this.all.tags(el);
  return 0;
}
if(!document.getElementsByTagName) document.getElementsByTagName = getElementsArray;
if(document.layers) Layer.prototype.getElementsByTagName = getElementsArray;

function show(div){
  if(document.all) window.document.all[div].style.visibility = 'visible';
  else if(document.layers) getObjByName(div).visibility = 'show';
  else document.getElementById(div).style.visibility = 'visible';
}
function hide(div){
  if(document.all) window.document.all[div].style.visibility = 'hidden';
  else if(document.layers) getObjByName(div).visibility = 'hide';
  else document.getElementById(div).style.visibility = 'hidden';
}

function swapImg() {
  if(!document.images) return;
  var args = swapImg.arguments;
  for(var i=0;i < args.length;i+=2) {
    var imgSrc = (args[i + 1].indexOf('[') != -1) ? eval(args[i + 1] + '.src') : args[i + 1];
    if(getObjByName(args[i])) getObjByName(args[i]).src = imgSrc;
  }
}

function nsfix(){setTimeout("window.onresize = rebrowse", 2000);}

function rebrowse(){window.location.reload();}

function infoinit(){
  ns4=(document.layers)?true:false, ie4=(document.all)?true:false;
  ie5=((ie4)&&((navigator.userAgent.indexOf('MSIE 5')>0)||(navigator.userAgent.indexOf('MSIE 6')>0)))?true:false;
  kon=(navigator.userAgent.indexOf('konqueror')>0)?true:false;
  x=0;y=0;winW=800;winH=600;
  idiv=null;
  if (followMe) {
    document.onmousemove = mousemove;
    if(ns4&&document.captureEvents) document.captureEvents(Event.MOUSEMOVE);
  }
  // Workaround for just another netscape bug: Fix browser confusion on resize
  // obviously conqueror has a similar problem :-(
  if(ns4||kon){ nsfix() }
  if(ns4) { px=""; }
}

function hide(name){
  idiv.visibility=ns4?"hide":"hidden";
  idiv=null;
}

function gettip(name){return (document.layers&&document.layers[name])?document.layers[name]:(document.all&&document.all[name]&&document.all[name].style)?document.all[name].style:document[name]?document[name]:(document.getElementById(name)?document.getElementById(name).style:0);}

function show(evt, name){
  if(idiv) hide(name);
  idiv=gettip(name);
  if(idiv){
   scrollX =0; scrollY=0;
   winW=(window.innerWidth)? window.innerWidth+window.pageXOffset-16:document.body.offsetWidth-20;
   winH=(window.innerHeight)?window.innerHeight+window.pageYOffset  :document.body.offsetHeight;
   scrollX=(typeof window.pageXOffset == "number")? window.pageXOffset:(document.documentElement && document.documentElement.scrollLeft)?document.documentElement.scrollLeft:(document.body && document.body.scrollLeft)?document.body.scrollLeft:window.scrollX;
   scrollY=(typeof window.pageYOffset == "number")? window.pageYOffset:(document.documentElement && document.documentElement.scrollTop)?document.documentElement.scrollTop:(document.body && document.body.scrollTop)?document.body.scrollTop:window.scrollY;
   popupW = document.getElementById(name).offsetWidth;
   popupH = document.getElementById(name).offsetHeight;   

   showtip(evt);
  }
}

function showtip(e){
  e = e? e: window.event;
  if(idiv) {
    if(e)   {
      x=e.pageX?e.pageX:e.clientX?e.clientX + scrollX:0; 
      y=e.pageY?e.pageY:e.clientY?e.clientY + scrollY:0;
    }
    else {
      x=0; y=0;
    }
    // MAke sure we don't go off screen
    if ( popupW > maxwidth ) { 
      popupW = maxwidth;
      idiv.width = maxwidth + px;
    }  
    idiv.left=(((x + popupW + xoffset)>winW)?x - popupW - xoffset:x + xoffset)+px;
    if ((popupH + yoffset)>winH) {
      idiv.top= yoffset + px;
    } else {
      idiv.top=(((y + popupH + yoffset)>winH)?winH - popupH - yoffset:y + yoffset)+px;
    }
    idiv.visibility=ns4?"show":"visible";
    }
}

function mousemove(e){
  showtip(e);
}

function subscribeFormTextCheck(t, dirn)
{
	if (dirn == 1 && t.value == "Enter Email...") t.value= "";
	if (dirn == 0 && t.value == "") t.value= "Enter Email...";
}