function flipValues(arr)
{	
	
	var myArr 	= 	arr.split("##");	
	var optName 	=  	myArr[0];	
	var unitprice 	=  	myArr[1];	
	var id 			= 	myArr[2];	
	var img 		= 	myArr[3];		
	var savings 	= 	myArr[4];	
	var listprice 	=  	myArr[5];		
	var pos 		=  	myArr[6];
	var groupid		=  	myArr[7];
	var sku			=  	myArr[8];	
	var sale		=  	myArr[9];		
	var originalprice	=  	myArr[10];	
	
	document.getElementById("optionid").value = id;	
//	document.getElementById("largepic").href = "javascript:enlargePic(''," + id + ");";
//	document.getElementById("largepiclink").href = "javascript:enlargePic(''," + id + ");";		
	document.getElementById("mainpic").src = img;
//	document.getElementById("mainpiclink").href = img.replace("standard","large");
	document.getElementById("ourprice1").innerHTML 	= unitprice;
	document.getElementById("ourprice2").innerHTML 	= unitprice;
	document.getElementById("savings").innerHTML 	= savings;	
	
	document.getElementById("opt_" + pos + "_" + groupid).value = id;	
	if(listprice !== "$0.00"){	document.getElementById("listprice").innerHTML 	= listprice; }
	else {document.getElementById("listpriceline").style.display='none';}
	document.getElementById("sku").innerHTML 	= sku;	
	
	if(sale == "True")
	{	document.getElementById("originalprice").innerHTML = originalprice;		
		document.getElementById("regpricing").style.display = 'none';		
		document.getElementById("salepricing3").style.display = 'none';
		document.getElementById("salepricing4").style.display = 'none';	
		document.getElementById("salepricing1").style.display = 'inline';
		document.getElementById("salepricing2").style.display = 'inline';
		}
	else
	{	if(parseInt(savings) == 0){
		document.getElementById("regpricing").style.display = 'inline';
		document.getElementById("salepricing1").style.display = 'none';
		document.getElementById("salepricing2").style.display = 'none';
		document.getElementById("salepricing3").style.display = 'none';
		document.getElementById("salepricing4").style.display = 'none';	
		}
		else{
		document.getElementById("regpricing").style.display = 'none';
		document.getElementById("salepricing1").style.display = 'none';
		document.getElementById("salepricing2").style.display = 'none';
		document.getElementById("salepricing3").style.display = 'inline';
		document.getElementById("salepricing4").style.display = 'inline';	
		}
	}
		
	if(parseInt(savings)==0){document.getElementById('savingsline').style.display='none';}
	else{document.getElementById('savingsline').style.display='inline';}
	
}


function populateOptionID(pos,groupid,id)
{	document.getElementById("opt_" + pos + "_" + groupid).value = id; }



function emailfriend(productid)
{window.open ('emailfriend.asp?productid=' + productid, 'newwindow', config='height=400, width=480, toolbar=no, menubar=no, scrollbars=auto, resizable=yes, location=no')}

function openPrint(productid)
{var optionid = document.getElementById("optionid").value;
window.open ('details_print.asp?productid=' + productid +'&optionid='+optionid, 'newwindow', config='height=600, width=700, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no')
}


function backOrder(){		
	rv = confirm('This item is back-ordered. Would you like to pre-order it?');	
	if (rv == true)
	{	return true;}	else {return false;}
}
	
function checkQuan(num){

if(parseInt(document.purchase.qty_1.value) < parseInt(num))
{alert('The customization text for this item will be removed since the quantity is less than ' + num);return false;}
else
{return true;}
}



function alternate(productid)
{	window.open('alternate.asp?productid=' + productid, 'newwindow', config='height=560, width=400, toolbar=no, menubar=no, scrollbars=auto, resizable=yes, location=no')}

function review(productid){
	window.open('review.asp?productID=' + productid, '_blank','width=450, height=400,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no');}
	
