<!-- // VLP static Cateogry and PD page
// Jeff Hoffmann
// 2-11-2003
// Site Design dept.
// http://www.digitalriver.com/

// Parse out SID value
var args = new Object();
var query = window.location.search.substring(1); // get query string
query = query.toLowerCase();
//alert(query);

while (query.indexOf("%26") != -1){ //fix for IE search string conversion.
	var goodSign = '&';
	var badSign = '%26';
	query = query.replace(badSign, goodSign);
}
//alert(query);

if (query == "" || query == "undefined"){
	var siteID = "27674";
}
else{
	var pairs = query.split("&");

	for (var i = 0; i < pairs.length;i++ ){
		var posit = pairs[i].indexOf('=');          // look for "name=value".
		if (posit == -1) continue;                  // if not found skip.
		var argname = pairs[i].substring(0,posit);  // extract the name.
		var value = pairs[i].substring(posit + 1);  // extract the value.
		args[argname] = unescape(value);	    // put into array
   
		if (argname == "sid"){
			var siteID = value;
		}
	}
}

//alert(siteID);

var baseDomain = 'http://nct.symantecstore.com/0060/';


function QtyError(over){

	if (over == 'no'){
		var errMsgUnder = 'Please update the quantity of the\nnumber of licenses you would\nlike to receive\n\n-- Field cannot have less than 10 units.\n-- Must not be over 250 units.\n-- Must contain only numbers';
		alert(errMsgUnder);
	}
	else if(over == 'yes'){
		var errMsgOver = 'Maximum number of licenses available through this site is 250 per product.\n-- For over 250 licenses, please visit one of our partners\n\nWould you like to view a list of partners now?';
		if (confirm(errMsgOver)){
			window.location.href = 'http://www.symantec.com/resellers/vlp/corporate-online.html';
		}


	}

}


function BuildParameters(nextPage,volumeVID,txtFld,mediaVID){
//alert(siteID);
	var qty = txtFld.value;
	if (qty == "" || qty < 10 || isNaN(qty)){
		QtyError('no');
		txtFld.focus();
	}
	else if (qty > 250){
		QtyError('yes');
		txtFld.focus();
	}
	else{
		//alert("valid");
		var url = baseDomain+nextPage+'?sid='+siteID+'&volume_vid='+volumeVID+'&qty='+qty+'&media='+mediaVID;
		//alert(url);
		window.location.href = url;
	}

}

function BuyUpgrade(nextPage,txtFld,mediaVID){
//alert(siteID);
	var qty = txtFld.value;
	if (qty == "" || qty < 10 || isNaN(qty)){
		QtyError('no');
		txtFld.focus();
	}
	else if (qty > 250){
		QtyError('yes');
		txtFld.focus();
	}
	else{
		//alert("valid");
		var url = baseDomain+nextPage+'?sid='+siteID+'&qty='+qty+'&media='+mediaVID;
		//alert(url);
		window.location.href = url;
	}

}


function GoToPDpage(nextPage){
	var url = baseDomain+nextPage+'?sid='+siteID;
	window.location.href = url;
}

// End -->
