
function GoTo( where )
{
	
	if( where == 'AGREE' )
	{
		var d = document.getElementById( 'DisclaimerBox' );
		d.style.display = "none";
		d = document.getElementById( 'FormBox' );
		d.style.display = "block";
	}
	else
		window.location.href="cnt/Pharmacy.html";
	
}


function SubmitForm()
{
	
	var frm = document.getElementById( "aspnetForm" );
	
	
	if( isBlank( frm.txtName.value ) || isEmpty( frm.txtName.value ) )
	{
		alert( "Please enter your name" );
		frm.txtName.focus();
		return;	
	}
	
	if( frm.ctl00_MainContent_selAge.selectedIndex < 1 )
	{
		alert( "Please select your age" );
		frm.ctl00_MainContent_selAge.focus();
		return;	
	}
		
	if( isBlank( frm.txtEmail.value ) || isEmpty( frm.txtEmail.value ) || ( !isEmail( frm.txtEmail.value ) ) )
	{
		alert( "Please enter a valid Email Address" );
		frm.txtEmail.focus();
		return;
	}
	
	var tempPhone;
	tempPhone = stripCharsInBag( frm.txtPhone.value, phoneNumberDelimiters );
	if( tempPhone != "" && !isUSPhoneNumber( tempPhone ) )
	{
		alert( iUSPhone );
		frm.txtPhone.focus();
		return;
	}
	else if( tempPhone != "" )
	{
		frm.txtPhone.value = reformatUSPhone( tempPhone );
	}
	
	if( isBlank( frm.txtInfo.value ) || isEmpty( frm.txtInfo.value ) )
	{
		alert( "Please enter your question" );
		frm.txtInfo.focus();
		return;				
	}
	
	var frm = document.getElementById( "aspnetForm" );
	frm.ctl00_MainContent_postBack.value = 1;

	frm.submit();
	
}

function SubmitDrugForm()
{
	
	var frm = document.getElementById( "aspnetForm" );
	var val = frm.ctl00_MainContent_txtSearch.value;
	var valid = true;
	
	
	if( val.length < 3 )
	{
		alert( "Your search term was not long enough, please enter at least 3 characters." );
		frm.ctl00_MainContent_txtSearch.focus();
		return;	
	}
	
	
	if( isBlank( val ) || isEmpty( val ) )
	{
		alert( "Please enter an name or partial name to search for" );
		frm.ctl00_MainContent_txtSearch.focus();
		return;	
	}
	
	if( !isAlphabetic( val ) && !isInteger( val ) )
	{
		alert( "Your search term is invalid" );
		frm.ctl00_MainContent_txtSearch.focus();
		return;	
	}
	
	if( val.indexOf( "<" ) != -1 )
		valid = false;
	else if( val.indexOf( ">" ) != -1 )
		valid = false;
	else if( val.indexOf( "&amp;gt" ) != -1 )
		valid = false;
	else if( val.indexOf( "&amp;lt" ) != -1 )
		valid = false;
	else if( val.indexOf( "(" ) != -1 )
		valid = false;
	else if( val.indexOf( ")" ) != -1 )
		valid = false;
	else if( val.indexOf( "{" ) != -1 )
		valid = false;
	else if( val.indexOf( "}" ) != -1 )
		valid = false;
		else if( val.indexOf( "%" ) != -1 )
		valid = false;
		
	if( !valid )
	{
		alert( "Your search term is invalid" );
		frm.ctl00_MainContent_txtSearch.focus();
		return;	
	}
	
	var frm = document.getElementById( "aspnetForm" );
	frm.ctl00_MainContent_postBack.value = 1;

	frm.submit();
	
}


/////////////////FAQ//////////////
var displayAll;

function ShowHideGroup( which, idprefix )
{

	displayAll = false;
	document.getElementById( idprefix + 'View' ).innerHTML = "View All";
	
	var elms = document.aspnetForm.getElementsByTagName( "div" );

	for( i = 0; i < elms.length; i++ )
	{
		if( elms[i].id.substr( 0, 3 ) == "Grp" )
			elms[i].style.display = "none";
	}
	
	
	switch( which )
	{
		case 1:
			document.getElementById( 'GrpOrderingBox' ).style.display = "block";
			break;
		case 2:
			document.getElementById( 'GrpOrderStatusBox' ).style.display = "block";
			break;
		case 3:
			document.getElementById( 'GrpDrugHealthInfoBox' ).style.display = "block";
			break;
		case 4:
			document.getElementById( 'GrpPrivacySecurityBox' ).style.display = "block";
			break;
		case 5:
			document.getElementById( 'GrpStoreLocationsBox' ).style.display = "block";
			break;
		case 6:
			document.getElementById( 'GrpMiscBox' ).style.display = "block";
			break;
	}

}



function ShowHideFAQ( id, idprefix )
{

	displayAll = false;
	document.getElementById( idprefix + 'View' ).innerHTML = "View All";
	
	var elms = document.aspnetForm.getElementsByTagName( "div" );
	
	for( i = 0; i < elms.length; i++ )
	{
		if( elms[i].id.substr( 0, 5 ) == idprefix )
			elms[i].style.display = "none";
	}
	
	if( document.getElementById( id ).style.display == "none" )
		document.getElementById( id ).style.display = "block";
	else
		document.getElementById( id ).style.display = "none";
	
}

			

function ViewAll( idprefix )
{
	
	if( !displayAll )
	{
		displayAll = true;
		document.getElementById( idprefix + 'View' ).innerHTML = "Hide All";
	}
	else
	{
		displayAll = false;
		document.getElementById( idprefix + 'View' ).innerHTML = "View All";
	}
	
	var elms = document.aspnetForm.getElementsByTagName( "div" );
	
	for( i = 0; i < elms.length; i++ )
	{
		if( elms[i].id.substr( 0, 5 ) == idprefix )
		{
		
			if( displayAll )
				elms[i].style.display = "block";
			else
				elms[i].style.display = "none";
		}
	}

}


function ChangeColor( obj, which )
{
	if( which == 1 )
		obj.style.backgroundColor = "#FFC4C7";
	else
		obj.style.backgroundColor = "Transparent";
}
