/************************************************************************************************
*
* THIS FILE CANNOT BE HIGHLIGHTED AS JAVA
* IF IT DOES THAT, THE "window.location" IN tryAgain() WILL BECOME CAPITALIZED
* AND IT WILL NOT WORK
**************************************************************************************************/

/**
* this function returns the query string (unparsed)
**/
function getQueryString() {
	var sLocation = new String(window.location);     //property contains domain, directory, 
                                                     //filename of the document plus the params (and the "?" before the params).
    var sParamsList = new String(sLocation.substr(sLocation.indexOf("?")+1)); // trying indexof instead of lastIndexOf
    return sParamsList;
   }

/**
* this function sends the page to lowvisioncookie.php
* that page automatically assumes that if you get there then you wanted to set the cookie
**/
function setLowVisionCookie() {
	var formObj = document.UserForm;
	formObj.target='main';
	formObj.action = "lowvisioncookie.php?true";
	formObj.submit();
}

/**
* this function sends the page to lowvisioncookie.php
* that page automatically assumes that if you get there then you wanted to set the cookie
**/
function deleteLowVisionCookie() {
	var formObj = document.UserForm;
	formObj.target='main';
	formObj.action = "lowvisioncookie.php?false";
	formObj.submit();
}

/**
* this function sends te page to datausecookie.php
* that page automatically assumes that if you get there then you want to set the cookie
**/
function setDataUse() {
	var qs = getQueryString();
	var formObj = document.UserForm;
	formObj.target='main';
	formObj.action = "datausecookie.php?true&"+qs;
	formObj.submit();
}

/** 
* this function redirects back to the data use cookie if it's not working correctly.
**/
function tryAgain(redirectURL) {
//	alert ("trying again");
//	alert (redirectURL);
	//window.location="http://www.yourdomain.com/";
	window.location = "datause.html?"+redirectURL; // MUST BE LOWERCASE "window.location"
}
