function slideMenu(id,div,indcolor){
	var obj=document.getElementById(div);
	if(obj.innerHTML=='' || obj.innerHTML=='&nbsp;' ){
		setTimeout("commonajax('newNavigationAjax.php','"+div+"','?catID="+id+"','<div align=center style=padding-top:50px><img src=includes/templates/rbClean/images/"+indcolor+"-loader.gif></div>');",500);
	}
}
function popUp(url, width, height, scrolls) 
	{
		winOptions = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + scrolls + ",resizable=yes,copyhistory=no,width=" + width + ",height=" + height + ",screenX=20,screenY=20";
		var win = window.open(url, '', winOptions);
		if (!win.opener)
			win.opener = self;
		if (win.focus) 
			win.focus();
	}

	function showdiv(rad,div){
		var r=document.getElementById(rad);
		var d=document.getElementById(div);
		if(d.style.display=="none"){
			d.style.display="block";
			if(div=="pmt-ccdiv")
				document.getElementById("pmt-coddiv").style.display="none";
			else
				document.getElementById("pmt-ccdiv").style.display="none";
		}
	}
 function checkCCForm(){
	var radcod=document.getElementById("pmt-cod"); 
 	var rad=document.getElementById("pmt-cc");
 	if(rad && radcod && !rad.checked && !radcod.checked){
 		alert("Please select a payment method");
 		return false;
 	}
 	if(!rad || rad.checked){
 	var n1=document.getElementById("n1").value;
 	var n2=document.getElementById("n2").value;
 	var n3=document.getElementById("n3").value;
 	var n4=document.getElementById("n4").value;
 	var owner=document.getElementById("cc-cc-owner").value;
 	var month=document.getElementById("cc-cc-expires-month");
 	var year=document.getElementById("cc-cc-expires-year");
 	var cvv=document.getElementById("cc-cc-cvv").value;
 	if(owner==""){
		alert("Please enter card owner\'s name");
		return false;
 	}
 	else if(n1=="" || n2=="" || n3=="" || n4==""){
 		alert("Please enter credit card number correctly");
 		return false;
 	}
 	else if(month.options[month.selectedIndex].value==0 || year.options[year.selectedIndex].value==0){
 		alert("Please select a expiration date");
 		return false;
 	}
 	else if(cvv=="")
 	{
		alert("Please enter CVV number");
 		return false;
 	}
 	else {
 		return true;
 	}
 	}
 }
 
 
 
 /***********************************************
* Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
* Copyright 2002-2007 by Sharon Paine
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/


var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 350;
var offX= 20;	// how far from mouse to show tip
var offY= 12; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF"; 
var tipBorderColor= "#000080";
var tipBorderWidth= 2;
var tipBorderStyle= "ridge";
var tipPadding= 4;

var messages = new Array();
messages[0]=new Array('','COD (Cash On Delivery) is a method of payment where you can buy products then make the payment at the time of delivery with money order or cashier\'s checks.<br>We do not accept personal checks.We do not require you to send us your money order.<br>You should give your money order (or your cashier\'s check) directly to the delivery person who will bring your item to your address.<br>All COD payments can be made in money order made out to <?=STORE_NAME?>.','','');
if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
  }
}
var startStr = '<table width="' + tipWidth + '">';
var midStr = '<tr><td valign="top" align="center">';
var endStr = '</td></tr></table>';

var startStr2 = '<table width="' + tipWidth + '">';
var midStr2 = '<tr><td valign="top" align="center">';
var endStr2 = '</td></tr></table>';
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = document.getElementById('tipDiv');
	tipcss = tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (ie4||ie5||ns5) {
		if (messages[num][0]==""){
			var tip = startStr2 + messages[num][0] + midStr2 + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr2;
		}
		else {
			var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		}
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
	mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	if (tipOn) positionTip(evt);
}
function positionTip(evt) {
	if (!tipFollowMouse) {
		standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
		mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
		mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
	var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = mouseX-(tpWd+offX)+"px";
	else tipcss.left = mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = winHt-(tpHt+offY)+"px";
	else tipcss.top = mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

document.write('<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:10000"></div>');

function showStockStatus(){
	var div=document.getElementById("stockStatus");
	var select=document.getElementById("attrib-1");
	div.innerHTML=select.options[select.selectedIndex].title;
}
 
 
 