function openWin(url,name,height,width,details) {

	if (name == null) {

		name='preview';

	}

	if (height==null || height=="") height=600;

	if (width==null || width=="") width=800;

	

	if (details == null || details=="") {

		details = 'scrollbars=yes,resizable=yes,menubar=yes,location=yes,status=yes,toolbar=yes,height=' + height +',width=' + width;	

	} else {

		details = details+',height=' + height +',width=' + width;

	} 

	

	x = window.open(url,name,details);

	x.focus();

	return;

}

	

function openVodPopup(url,name,height,width,details) {

		if (url == null || url == "") url = "/schedule/show.jsp?id=2";

		if (name == null || name == "") name = 'vodPop';

		if (height == null || height == "") height = 450;

		if (width == null || width == "") width = 350;

		if (details == null || details == "") details = 'scrollbars=no,resizable=no,menubar=no,location=no,status=no,toolbar=no'; 

		openWin(url,name,height,width,details); 

		return;

}



function openSendToFriendPopup(url,name,height,width,details) {

	if (url == null || url == "") url = "/sendToFriend.html";

	if (name == null || name == "") name = 'sendToFriend';

	if (height == null || height == "") height = 350;

	if (width == null || width == "") width = 500;

	if (details == null || details == "") details = 'scrollbars=no,resizable=no,menubar=no,location=no,status=no,toolbar=no';

	openWin(url,name,height,width,details);

	return;

}



function openTermsAndConditionsPopup(url,name,height,width,details) {

	if (url == null || url == "") url = location.protocol + "//" + location.hostname + "/letsgoshow/terms.html";

	if (name == null || name == "") name = 'termsAndConditions';

	if (height == null || height == "") height = 600;

	if (width == null || width == "") width = 515;

	if (details == null || details == "") details = 'scrollbars=yes,resizable=no,menubar=no,location=no,status=no,toolbar=no';

	openWin(url,name,height,width,details);

	return;

}



function openPrivacyPolicyPopup(url,name,height,width,details) {

	if (url == null || url == "") url = location.protocol + "//" + location.hostname + "/letsgoshow/privacy.html";

	if (name == null || name == "") name = 'privacyPolicy';

	if (height == null || height == "") height = 600;

	if (width == null || width == "") width = 515;

	if (details == null || details == "") details = 'scrollbars=yes,resizable=no,menubar=no,location=no,status=no,toolbar=no'; 

	openWin(url,name,height,width,details);

	return;

}



function PageQuery(q) {

	if(q.length > 1) this.q = q.substring(1, q.length);

	else this.q = null;

	

	this.keyValuePairs = new Array();

	if(q) {

		for(var i=0; i < this.q.split("&").length; i++)

		{

			this.keyValuePairs[i] = this.q.split("&")[i];

		}

	}

	

	this.getKeyValuePairs = function() { return this.keyValuePairs; }

	this.getValue = function(s) {

		for(var j=0; j < this.keyValuePairs.length; j++) {

			if(this.keyValuePairs[j].split("=")[0] == s)

				return this.keyValuePairs[j].split("=")[1];

		}

		return false;

	}

	

	this.getParameters = function() {	

		var a = new Array(this.getLength());

		for(var j=0; j < this.keyValuePairs.length; j++) {

			a[j] = this.keyValuePairs[j].split("=")[0];

		}

		return a;

	}

	

	this.getLength = function() {

		return this.keyValuePairs.length;

	}

}



function queryString(key){

	var page = new PageQuery(window.location.search);

	return unescape(page.getValue(key));

}



function displayItem(key){

	if(queryString(key)=='false') return 0;

	else return queryString(key);

}

function Get_Sprout()
{
	window.open("mailto:info@sproutonline.com?subject=Tell me how to get Sprout in my area&body=Please fill in your zip code and current provider below. We'll email you a list of providers that carry Sprout in your area.%0A%0AZip Code:%0A%0ACurrent Cable or Satellite Provider:%0A%0AThank you for your interest in Sprout!", "win2");

}

