function fnSubmit(){
//-------------------------------------------------------------------
	var strURL			= '/cart/add_to_cart.asp?pid=<%=Request.QueryString("pid")%>';
	var strRelated		= '';
	var strBuyPattern	= '';
	var strHotItems		= '';
	var strviewed		= '';
	var strWarranty		= '';
	var intQuantity		= 1;
	var intaccQuantity	= 1;

	if ( document.ProductForm.txtQuantity.value ) intQuantity = document.ProductForm.txtQuantity.value;
	
	var txtRelated		= document.ProductForm.related;
	var txtBuyPattern	= document.ProductForm.buypattern;
	var txtHotItems		= document.ProductForm.hotitems;
	var txtViewed		= document.ProductForm.viewed;
	var txtWarranty		= document.ProductForm.Warrenty;


	if (txtRelated != undefined)
	{
		if (txtRelated.length != undefined)
		{
			for(var count=0; count<txtRelated.length; count++)
				{
				if(txtRelated[count].checked == true) {
					if ( document.ProductForm.txtaccQty[count].value ) intaccQuantity = document.ProductForm.txtaccQty[count].value;
					strRelated = strRelated + txtRelated[count].value + '_' + intaccQuantity + ',';
					//alert(strRelated)
					}
				}
		}
		else
		{
			if(txtRelated.checked == true) strRelated = strRelated + txtRelated.value + '_' + intaccQuantity + ',';
		}
	}

	if (txtBuyPattern != undefined)
	{
		if (txtBuyPattern.length != undefined)
		{
			for(var count=0; count<txtBuyPattern.length; count++) {
				if(txtBuyPattern[count].checked == true) strBuyPattern = strBuyPattern + txtBuyPattern[count].value + ',';
				}
		}
		else
		{
			if(txtBuyPattern.checked == true) strBuyPattern = strBuyPattern + txtBuyPattern.value + ',';
		}
	}

	if (txtHotItems!= undefined)
	{
		if ((txtHotItems.length)!= undefined)
		{
			for(var count=0; count<txtHotItems.length; count++){
				if(txtHotItems[count].checked == true) strHotItems = strHotItems + txtHotItems[count].value + ',';
				}
		}
		else {
			if(txtHotItems.checked == true)	strHotItems = strHotItems + txtHotItems.value + ',';
		}
	}

	if (txtViewed != undefined)
	{	if (txtViewed.length != undefined)
		{
			for(var count=0; count<txtViewed.length; count++)
				{
				if(txtViewed[count].checked == true) strviewed = strviewed + txtViewed[count].value + ',';
				}
		}
		else
		{
			if(txtViewed.checked == true) strviewed = strviewed + txtViewed.value + ',';
		}
	}


	if (txtWarranty != undefined)
	{	if (txtWarranty.length != undefined)
		{
			for(var count=0; count<txtWarranty.length; count++)
				{
				if(txtWarranty[count].checked == true) strWarranty = strWarranty + txtWarranty[count].value + ',';
				}
		}
		else
		{
			if(txtWarranty.checked == true) strWarranty = txtWarranty.value + ',';
		}
	}

	strURL = strURL + "&Qty=" + intQuantity + "&Rel=" + strRelated + "&BuyPtn=" + strBuyPattern + "&hotitem=" + strHotItems + "&viewed=" + strviewed + "&Wrty=" + strWarranty;
	window.location.href = strURL;
}	//end function: fnSubmit

function Rcertify() 
{
	popupWin = window.open('http://www.bbbonline.org/cks.asp?id=10207169401923874', 'Participant','location=yes,scrollbars=yes,width=450,height=300');
	self.name = 'opener';
} 
function pricegrabber() 
{
	popupWin = window.open('http://www.pricegrabber.com/rating_getreview.php/retid=408','Participant','location=yes,scrollbars=yes,width=600,height=600');
	self.name = 'opener';
}
function bizrate() 
{
	popupWin = window.open('http://www.bizrate.com/ratings_guide/cust_reviews__mid--31341.html',"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=600,height=600');
	self.name = 'opener';
}
function pricescan() 
{
	popupWin = window.open('http://www.pricescan.com/vendors/ratings/pcuniverse.asp',"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=600,height=600');
	self.name = 'opener';
}
function HPconfig()
{
	window.open("http://pcuniverse.hpsupplieslink.com", "new_win","width=650,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes")
}
function CableConfig()
{
	window.open("http://www.CablesToGo.com/pcu/configurator.asp", "new_win","width=650,height=700,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes")
}
function KingstonConfig()
{
	window.open("http://www.ec.Kingston.com/ecom/config/?referid=727", "new_win","width=650,height=700,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes")
}
function BML_Core()
{
window.open("Include/BML_Core_PopUp_Template_08.17.2005.html","win1","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=520, height=750, top = 120 left = 500");
}

function fnEmailFriend() {
	var strURL_Email = "Product/Email_a_Friend.asp?<%=Request.QueryString%>";
	strURL_Email = strURL_Email + "&pname=<%=prdname%>" + "&price=<%=prdPrice%>";
	var newWin = window.open(strURL_Email,"","HEIGHT =560,WIDTH=585");
}

function vldQuantity()	{
if (!isInteger(document.getElementByID("txtQuantity").value)) {
			alert("Quantity must be a positive number. Setting quantity to 1");
			document.getElementByID("txtQuantity").value = "1";
			return false;
		}
}

function vldAccQuantity()	{
if (!isInteger(document.getElementByID("txtaccQty").value)) {
			alert("Quantity must be a positive number. Setting quantity to 1");
			document.getElementByID("txtaccQty").value = "1";
			return false;
		}
}

function ShowImagesWindow()	{
	var strURL = 'product_images.asp?pid=1';
	var newWin = window.open(strURL, "", "width=500, height=375, toolbar=no, location=no, menubar=no");
}
function whybuypcufaq()
{
window.open("/whybuypcufaq.asp","my_new_window",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,screenX=50,left=50,screenY=200,top=200,width=772,height=350')
}
function fnWarranty() {
	var strURL_Warranty = "warrantyfaq.asp";
	var newWin = window.open(strURL_Warranty,"","HEIGHT =680,WIDTH=700,scrollbars");
}

function fnShipping() {
	var newWin = window.open("/freeshipping.asp","my_new_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=550, height=350")
}

function popupMAP() {
	var newWin = window.open("/include/MAP.html","MAPwin","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=550, height=250");
}

function ShowImagesWindow()	{
	var strURL = 'product_images.asp?pid=1';
	var newWin = window.open(strURL, "", "width=500, height=375, toolbar=no, location=no, menubar=no");
}
function isInteger(val) {
	if (isBlank(val)){return false;}
	for(var i=0;i<val.length;i++){
		if(!isDigit(val.charAt(i))){return false;}
		}
	return true;
}

function isDigit(num) {
	if (num.length>1){return false;}
	var string="1234567890";
	if (string.indexOf(num)!=-1){return true;}
	return false;
}


function ShowAddProductToAccountListWindow(ValuePID, ValueName)	{
	var strURL = 'add_product_to_account_list.asp?pid=' + ValuePID + '&pname=' + ValueName;
	var newWin = window.open(strURL, "", "width=450, height=150, toolbar=no, location=no, menubar=no");
}

function ShowRealTimeWindow(intDistID, ValueID, ValueSKU, ValueName)	{

	var strURL = 'realtime.asp?dpid=' + ValueID + '&pname=' + ValueName + '&dSKU=' + ValueSKU + '&dist=' + intDistID;
	var newWin = window.open(strURL, "", "width=650, height=600, toolbar=no, location=no, menubar=no");
}

function ShowRealTimeWindow2(intDistID, ValueID, ValueSKU, ValueName)	{
	var strURL = 'realtime.asp?dpid=' + ValueID + '&pname=' + ValueName + '&dSKU=' + ValueSKU + '&dist=' + intDistID;
	var newWin = window.open(strURL, "", "width=450, height=300, toolbar=no, location=no, menubar=no");
}
function ShowRealTimeWindow2(intDistID, ValueID, ValueSKU, ValueName)	{
	var strURL = 'realtime.asp?dpid=' + ValueID + '&pname=' + ValueName + '&dSKU=' + ValueSKU + '&dist=' + intDistID;
	var newWin = window.open(strURL, "", "width=450, height=300, toolbar=no, location=no, menubar=no");
}

function ShowWarehouseListWindow(ValuePID, ValueDID, ValueName)	{

	var strURL = 'whlist.asp?pid=' + ValuePID + '&did=' + ValueDID + '&pname=' + ValueName;
	var newWin = window.open(strURL, "", "width=650, height=280, toolbar=no, location=no, menubar=no");
}
