function activeTab(tabNo){
	switch (tabNo){
		case 1:
			document.getElementById("tab1").style.display  = "block";
			document.getElementById("tab2").style.display  = "none";
			document.getElementById("tab2").style.overflow = "auto";
			document.getElementById("tab3").style.display  = "none";
			document.getElementById("tab4").style.display  = "none";
			reverseTab(1);
			break;
		case 2:
			document.getElementById("tab1").style.display  = "none";			
			document.getElementById("tab2").style.display  = "block";
			document.getElementById("tab3").style.display  = "none";
			document.getElementById("tab4").style.display  = "none";			
			reverseTab(2);
		
			break;
		case 3:
			document.getElementById("tab1").style.display  = "none";
			document.getElementById("tab2").style.display  = "none";
			document.getElementById("tab3").style.display  = "block";
			document.getElementById("tab4").style.display  = "none";
			reverseTab(3);
			break;
		case 4:
			document.getElementById("tab1").style.display  = "none";
			document.getElementById("tab2").style.display  = "none";
			document.getElementById("tab3").style.display  = "none";
			document.getElementById("tab4").style.display  = "block";
			reverseTab(4);
			break;
		}
}


function reverseTab(tabNo){
	for (i=1; i<=4; i++){
		if (i != tabNo){
			document.getElementById("tab"+ i +"_left_conner").src = "images/tab_inactive_left_corner.gif";
			document.getElementById("tab"+ i +"_top").className = "tab_top";
			document.getElementById("tab"+ i +"_right_conner").src = "images/tab_inactive_right_corner.gif";
			
			document.getElementById("tab"+ i +"_left").className = "tab_left_side";
			document.getElementById("tab"+ i +"_content").className = "tab_text";
			document.getElementById("tab"+ i +"_right").className = "tab_right_side";
		}else{
			document.getElementById("tab"+ i +"_left_conner").src = "images/tab_active_left_corner.gif";
			document.getElementById("tab"+ i +"_top").className = "tab_top_active";
			document.getElementById("tab"+ i +"_right_conner").src = "images/tab_active_right_corner.gif";
			
			document.getElementById("tab"+ i +"_left").className = "tab_left_side_active";
			document.getElementById("tab"+ i +"_content").className = "tab_text_active";
			document.getElementById("tab"+ i +"_right").className = "tab_right_side_active";
		}
	}
}


function fnSubmit(){
	var strURL			= 'http://www.patriotpc.us/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 + ',';
					
					}
				}
		}
		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)
	{	alert('Hi');
		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;
}	

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 fnNotebooks()
{
	window.open("http://www.apricorn.com/config/config.php?reseller_id=111", "new_win","width=800,height=500,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("https://www.securecheckout.billmelater.com/paycapture-content/fetch?hash=PW630TDN&content=/bmlweb/coreiw.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 = "http://www.patriotpc.us/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 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 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 = 'http://www.patriotpc.us/product_images.asp?pid=1';
	var newWin = window.open(strURL, "", "width=500, height=375, toolbar=no, location=no, menubar=no");
}


function ShowAddProductToAccountListWindow(ValuePID, ValueName)	{

	var strURL = 'http://www.patriotpc.us/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 whybuypcufaq()

{
window.open("http://www.patriotpc.us/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=730,scrollbars");
}

function fnShipping() {

	var newWin = window.open("http://www.patriotpc.us/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("http://www.patriotpc.us/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 = 'http://www.patriotpc.us/product_images.asp?pid=1';
	var newWin = window.open(strURL, "", "width=500, height=375, toolbar=no, location=no, menubar=no");
}



function ShowRealTimeWindow(intDistID, ValueID, ValueSKU, ValueName)	{

	var strURL = 'http://www.patriotpc.us/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 = 'http://www.patriotpc.us/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 = 'http://www.patriotpc.us/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 = 'http://www.patriotpc.us/whlist.asp?pid=' + ValuePID + '&did=' + ValueDID + '&pname=' + ValueName;
	var newWin = window.open(strURL, "", "width=650, height=280, toolbar=no, location=no, menubar=no");
}

	function fnTechDollarInfo(){
		var strURL = "http://www.patriotpc.us/techpointsfaq_popup.asp";
		//alert (strURL_Warranty) ;
		window.open(strURL,"","HEIGHT =600,WIDTH=740,scrollbars");
	}	
function feedbackForm(pid)
{
	//popupStr = "http://www.patriotpc.us/feedback_popup.asp?pid=" + pid;
	//popupWin = window.open(popupStr, '','location=no,scrollbars=yes,width=470,height=725');
	tb_show('Feedback Form','feedback_popup.asp?pid=' + pid + '#TB_iframe=true&height=725&width=470');
}