// JavaScript Document
PositionX = 400;
PositionY = 300;
defaultWidth  = 200;
defaultHeight = 200;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
imageURL='http://www.pcuniverse.com/'+imageURL;
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>PCUniverse.com - Loading...</title><base href=http://www.pcuniverse.com/><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');

writeln('width=document.images[0].width;');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');

writeln('window.resizeTo(width,height);}');
writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}');
writeln('}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}



function fnSubmit(){

	var strURL			= 'http://www.pcuniverse.com/cart/add_to_cart.asp?pid=<%=Request.QueryString("pid")%>';
	var strRelated		= '';
	var strBuyPattern	= '';
	var strHotItems		= '';
	var strviewed		= '';
	var strWarranty		= '';
	var strShipping     = '';
	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;
	var txtShipping     = document.ProductForm.ship;


	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)
	{	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 + ',';
		}
	}
	
	if (txtShipping != undefined)
	{	if (txtShipping.length != undefined)
		{
			for(var count=0; count<txtShipping.length; count++)
				{
				if(txtShipping[count].checked == true) strShipping = strShipping + txtShipping[count].value + ',';

				}
		}
		else
		{
			if(txtShipping.checked == true) strShipping = txtShipping.value + ',';
		}
	}

	strURL = strURL + "&Qty=" + intQuantity + "&Rel=" + strRelated + "&BuyPtn=" + strBuyPattern + "&hotitem=" + strHotItems + "&viewed=" + strviewed + "&Wrty=" + strWarranty + "&Shipprice=" + strShipping;
	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 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.pcuniverse.com/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.pcuniverse.com/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.pcuniverse.com/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.pcuniverse.com/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 = "http://www.pcuniverse.com/warrantyfaq.asp";
	var newWin = window.open(strURL_Warranty,"","HEIGHT =680,WIDTH=700,scrollbars");
}

function fnShipping() {

	var newWin = window.open("http://www.pcuniverse.com/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.pcuniverse.com/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.pcuniverse.com/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.pcuniverse.com/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.pcuniverse.com/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 fnFreeShipInfo(){
		var strURL = "http://www.pcuniverse.com/freeshipping.asp";

		window.open(strURL,"","HEIGHT =190,WIDTH=620,scrollbars");
}	


function ShowWarehouseListWindow(ValuePID, ValueDID, ValueName)	{

	var strURL = 'http://www.pcuniverse.com/whlist.asp?pid=' + ValuePID + '&did=' + ValueDID + '&pname=' + ValueName;
	var newWin = window.open(strURL, "", "width=650, height=280, toolbar=no, location=no, menubar=no");
}


var newwindow
function popwindow1(url)
{
	
	newwindow=window.open(url,'name','height=395,width=700,status=no,titlebar=no,toolbar=0,resizable=yes,scrollbars=1,left=160,top=150');
	
	
}

function selectAll(formObj, isInverse) 
{
   
   for (var i=0;i < formObj.length;i++) 
   {
      fldObj = formObj.elements[i];
      if (fldObj.type == 'radio')
      { 
         
			if (fldObj.checked) {
		
			if (fldObj.value=="") {
			}
			else{
			fldObj.checked=false
			}

			}

        
       }
   }
}