/* JavaScript PCInet */

/* Basket BASK */
function validate_logn(emid,pwid){
	var em=document.getElementById(emid);
	if ((em.value==null)||(em.value=="")){
		alert("To login, please enter your e-mail address.");
		em.focus();
		return false;
	}
	if (echeck(em.value)==false){
		em.value="";
		em.focus();
		return false;
	}
	if(pwid.length > 0){
		var pw=document.getElementById(pwid);
		if ((pw.value==null)||(pw.value=="")){
			alert("To login, please enter your password.");
			pw.focus();
			return false;
		}
	}
	return true;
}

function checkout_clicked(){
  var bask_related=document.getElementById('bask_related');
  var bask_login=document.getElementById('bask_login');
  bask_related.style.display="none";
  bask_login.style.display="block";
  return false;
}

function bigImage(obj){
	var img=document.getElementById("bigimage");
	img.src=obj.src;
}

/* 	Script Source: CodeLifter.com
	Copyright 2003
	Do not remove this header
	Modified by Ray Yates -- http://www.yatesoft.com
*/

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");  
  hotDog=isIE ? event.srcElement : e.target;  
  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  }  
  if (hotDog.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}

function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;  
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hideMe(){
  document.forms.PRODProducts.Quantity.style.visibility="visible";
  if (isIE||isNN) whichDog.style.visibility="hidden";
  else if (isN4) document.theLayer.visibility="hide";
}

function showMe(disp){
  var ie6hide = false;
  if(disp == 'A') {
  	if( document.getElementById("theImages") ){
	   	for (var i=1;i<=5;i++){ 
	   		if(src[i]){
		   		document.getElementById("img"+i).src=src[i];
		   		if(i==1){
		   			document.getElementById("bigimage").src=src[1];
		   		}
		   	}
	   	}
	  	document.getElementById("theImages").style.display="block";
	  	if( document.getElementById("theLargeImage") ) document.getElementById("theLargeImage").style.display="none";
	  	document.getElementById("theLayer").style.left="250";
	  	document.getElementById("theLayer").style.top="200";
	  	document.getElementById("theLayer").style.width="397";
	  	var ie6hide = true;
	}
  } else {
  	if( document.getElementById("theLargeImage") ){
	  	document.getElementById("largeImage").src=src[0];
	  	if( document.getElementById("theImages") ) document.getElementById("theImages").style.display="none";
	  	document.getElementById("theLargeImage").style.display="block";
	  	document.getElementById("theLayer").style.left="10";
	  	document.getElementById("theLayer").style.top="10";
	  	document.getElementById("theLayer").style.width="722";
	  	var ie6hide = true;
	}
  }
  if(ie6hide) document.forms.PRODProducts.Quantity.style.visibility="hidden";
  
  if (isIE||isNN) whichDog.style.visibility="visible";
  else if (isN4) document.theLayer.visibility="show";
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");
