var W3CDOM = (document.createElement && document.getElementsByTagName);

var mouseOvers = new Array();
var mouseOuts = new Array();
window.onload = init;

function myclose() {
	self.close();
}
  

function toggle_fields() {
		document.forms[0].credit_card_card_type.disabled = document.forms[0].order_invoice.checked;
		document.forms[0].credit_card_card_number.disabled = document.forms[0].order_invoice.checked;
		document.forms[0].elements[4].disabled = document.forms[0].order_invoice.checked;
		document.forms[0].elements[5].disabled = document.forms[0].order_invoice.checked;
		document.forms[0].credit_card_security_code.disabled = document.forms[0].order_invoice.checked;
}

function init()
{
   if (!W3CDOM) return;
   var nav = document.getElementById('links');
   var imgs = nav.getElementsByTagName('img');
   var strUrl = window.location.href;
   for (var i=0;i<imgs.length;i++)
   {
      imgs[i].onmouseover = mouseGoesOver;
      imgs[i].onmouseout = mouseGoesOut;
      var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.'));
      mouseOuts[i] = new Image();
      mouseOuts[i].src = imgs[i].src;
      mouseOvers[i] = new Image();
      mouseOvers[i].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf('.')) + "-on" + suffix;
      imgs[i].number = i;
   }
   if(strUrl.indexOf("store")>0) {
   P7_equalCols('left','right')
   }
}

function mouseGoesOver()
{
   this.src = mouseOvers[this.number].src;
}

function mouseGoesOut()
{
   this.src = mouseOuts[this.number].src;
}

sfHover = function() {
  var sfEls = document.getElementById("nav").getElementsByTagName("LI");
  for (var i=0; i<sfEls.length; i++) {
    sfEls[i].onmouseover=function() {
      this.className+=" sfhover";
    }
    sfEls[i].onmouseout=function() {
      this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
    }
  }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


/* 
  ------------------------------------------------
  PVII Equal CSS Columns
  Copyright (c) 2005 Project Seven Development
  www.projectseven.com
  Version: 1.6.0
  ------------------------------------------------
*/
function P7_colH(){ //v1.6 by PVII-www.projectseven.com
 var i,oh,hh,h=0,dA=document.p7eqc,an=document.p7eqa;
	
	if(dA&&dA.length){
 		for(i=0;i<dA.length;i++){
			dA[i].style.height='auto';
		}
		for(i=0;i<dA.length;i++){
			oh=dA[i].offsetHeight;
			h=(oh>h)?oh:h;
		}
		for(i=0;i<dA.length;i++){
			if(an){
 				dA[i].style.height=h+'px';
			}else{
				P7_eqA(dA[i].id,dA[i].offsetHeight,h);
			}
		}
		if(an){
 			for(i=0;i<dA.length;i++){
				hh=dA[i].offsetHeight;if(hh>h){
 					dA[i].style.height=(h-(hh-h))+'px';
				}
			}
		}else{document.p7eqa=1;}
 		document.p7eqth=document.body.offsetHeight;
 		document.p7eqtw=document.body.offsetWidth;
	}
}
function P7_eqT(){ //v1.6 by PVII-www.projectseven.com
 if(document.p7eqth!=document.body.offsetHeight||document.p7eqtw!=document.body.offsetWidth){
 P7_colH();}
}
function P7_equalCols(){ //v1.6 by PVII-www.projectseven.com
 if(document.getElementById) {
		document.p7eqc=new Array;
		for(var i=0;i<arguments.length;i++) {
 			document.p7eqc[i]=document.getElementById(arguments[i]);
		}
		setInterval("P7_eqT()",10);
	}
}
function P7_eqA(el,h,ht){ //v1.6 by PVII-www.projectseven.com
 var sp=10,inc=20,nh=h,g=document.getElementById(el),oh=g.offsetHeight,ch=parseInt(g.style.height);
 ch=(ch)?ch:h;var ad=oh-ch,adT=ht-ad;nh+=inc;nh=(nh>adT)?adT:nh;g.style.height=nh+'px';
 oh=g.offsetHeight;if(oh>ht){nh=(ht-(oh-ht));g.style.height=nh+'px';}
 if(nh<adT){setTimeout("P7_eqA('"+el+"',"+nh+","+ht+")",sp);}
}
