// JavaScript Document

function getCookieData(label) {
    var labelLen = label.length
    var cLen = document.cookie.length
    var i = 0
    var cEnd
    while (i < cLen) {
        var j = i + labelLen
        if (document.cookie.substring(i,j) == label) {
            cEnd = document.cookie.indexOf(";",j)
            if (cEnd == -1) {
                cEnd = document.cookie.length
            }
            return unescape(document.cookie.substring(j,cEnd))
        }
        i++
    }
    return null
}
function cookieTreat() {
	var exp = new Date()
	var oneYearFromNow = exp.getTime() + (365 * 24* 60 * 60 * 1000)
	exp.setTime(oneYearFromNow)
	 
	var today = new Date()
	 
	var checkref = new String(" ")
	if(document.referrer.length > 0) {
		checkref = checkref + document.referrer
	}
	else {
		checkref = checkref + "No Referrer"
	}
	 
	 // set document cookie if they have not been written yet
	 // if referrer cookie exists, do nothing
	 // otherwise write all three cookies
	if (getCookieData("cookieRefURL") && getCookieData("cookieLandURL") && getCookieData("cookieDate")) { 
	} else {
		document.cookie = "cookieRefURL=" + checkref + "; domain=204.202.236.17; expires=" + exp.toGMTString() + "; path=/"
		document.cookie = "cookieLandURL=" + location + "; domain=204.202.236.17; expires=" + exp.toGMTString() + "; path=/"
		document.cookie = "cookieDate=" + today + "; domain=204.202.236.17; expires=" + exp.toGMTString() + "; path=/"
	}
}
document.onLoad=cookieTreat();

function errorsuppressor(){
return true
}
window.onerror=errorsuppressor


function openPrivacy(){
		newWindow=window.open('/privacy_policy.aspx','','width=400,height='+screen.height-200+',location=yes,status=no,toolbars=yes,resizable=yes,scrollbars=yes');
} 
function openTerms(){
		newWindow=window.open('/terms_conditions.aspx','','width=400,height='+screen.height-200+',location=yes,status=no,toolbars=yes,resizable=yes,scrollbars=yes');
} 
function csc(){
		newWindow=window.open('/help/csc.aspx','','width=450,height=400,location=yes,status=no,toolbars=yes,resizable=yes,scrollbars=yes');
} 
		
		
		
function confirmDelete(section){
	if (confirm('Are you sure you want to delete this '+section+'?')){
			return true;
		} else {
			return false;
		}
}