//===================================================
//
// catalog.js
// Copyright © 2001, Christopher Lee, All Rights Reserved
//===================================================


function VS()
{

	//
	// temporary mod 4-30-03
	
//	var newWindow = "Upgrade.asp";
//		window.open(newWindow,'Upgrade_In_Progress','width=550,scrollbars=yes,height=250,top='+screen.availTop+',left='+screen.availLeft);
//	return
//	alert("dev01 site message\n\nedit -gateway-include-catalog.js to turn this message off and enable the Upgrade In Progress page.\n\nClick OK to Proceed");


	//
	// make sure something is selected, Quantity>0 and not a combo sub
	//
	// if '*' is selected, set to default - this is a combo sub
	//


	var obj = document.forms[1].Pricing;
	var SelectedFlag = false;
	var strLeft1;

	if(obj[0].length > 1)
	{
		for(var i = 0; i < obj.length; i++)
		{
			strLeft1 = obj[i].options[obj[i].selectedIndex].text;
			strLeft1 = strLeft1.substr(0,1);

			if(obj[i].options[obj[i].selectedIndex].value != '0' && strLeft1 != '*')
			{
				SelectedFlag = true;
			}
			if(strLeft1 == '*')
			{
				obj[i].options[0].selected = true;
			}

		}
	}
	else
	{
		strLeft1 = obj.options[obj.selectedIndex].text;
		strLeft1 = strLeft1.substr(0,1);
		if(obj.options[obj.selectedIndex].value != '0' && strLeft1 != '*')
		{
			SelectedFlag = true;
		}
		if(strLeft1 == '*')
		{
			obj.options[0].selected = true;
		}
	}


	if(SelectedFlag == true)
	{
		document.forms[1].submit();
		return true;
	}
	else
	{
		alert('You must select at least one subscription before proceeding.');	
	}

}

function GoToCategory()
{
	document.Main.Page.value="1";
	document.Main.Catalog_RID.value = "0";
	document.Main.GoToCatFlag.value = "True";
	document.Main.action="main_Catalog.asp";
	document.Main.submit();
	return;
}

function GoToPage(Nbr)
{
	//
	// deselect all
	//
	var obj = document.forms[1].Pricing;
		
	if(obj[0].length > 1)
	{
		for(var i = 0; i < obj.length; i++)
		{

			if(obj[i].options[obj[i].selectedIndex].value != '0')
			{
				obj[i].selectedIndex = 0;
			}
		}
	}
	else
	{
		if(obj.options[obj.selectedIndex].value != '0')
		{
			obj.selectedIndex = 0;
		}
	}


	document.Main.GoToCatFlag.value = "True";
	document.forms[1].Page.value = Nbr;
	document.forms[1].Catalog_RID.value = "0";
	document.forms[1].action="main_Catalog.asp";
	document.forms[1].submit();
	return;
}

function Check4ComboSubscription(in_obj)
{
	//
	// check first charactor for '*'
	//

	var obj = in_obj;
	var strLeft1;
	strLeft1=obj.options[obj.selectedIndex].text.substr(0,1);

	if(strLeft1=='*')
	{
		var newWindow = "Popup_Contact.asp?msg=" + obj.options[obj.selectedIndex].text;
		var winHandle = window.open(newWindow,'Contact_Us','width=550,scrollbars=yes,height=250,top='+screen.availTop+',left='+screen.availLeft);
		obj.options[0].selected = true;
	}

	return
}



