function getCookie(c_name)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1)
			{ 
				c_start=c_start + c_name.length+1; 
				c_end=document.cookie.indexOf(";",c_start);
				if (c_end==-1) c_end=document.cookie.length;
				return unescape(document.cookie.substring(c_start,c_end));
			} 
	}
	return "";
}

function setCookie()
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+365);
	document.cookie="smudSurvey="+escape("Y")+";expires="+exdate.toGMTString()+";path=/";
}

function checkCookie()
{
	surveySet=getCookie('smudSurvey');
	if (surveySet==null || surveySet=="")
	{
		window.open("../../../../../../homesuite/calcs/rescalc/survey/smud_feedback.aspx", "surveyWindow", "width=400, height=375, directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no, top=200,left=200");
		//window.open("../../../../../../calcs/rescalc/survey/smud_feedback.aspx", "surveyWindow", "width=400, height=375, directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no, top=200,left=200");
  	}
	
}

function checkPage()
{
	//if (document.location.href=="http://10.0.0.57/" || document.location.href=="http://10.0.0.57/calcs/rescalc/default_supp.aspx")
	if (document.location.href=="http://smud.apogee.net/homesuite/calcs/rescalc/default_supp.aspx")
	//if (document.location.href=="http://10.0.0.57/calcs/rescalc/viewMonthly.aspx" || document.location.href=="http://10.0.0.57/calcs/rescalc/viewReport.aspx")
	//if (document.location.href=="http://10.0.0.57/calcs/rescalc/default_supp.aspx")
	{
		checkCookie();
	}
}

function checkChoice()
{
	if (document.askSurvey.noThanks.checked == true)
	{
		setCookie();
		window.close();
	}
	else
	{
		opener.location.href = "http://smud.apogee.net/homesuite/calcs/rescalc/survey/smud_survey.aspx";
		//opener.location.href = "http://10.0.0.57/calcs/rescalc/survey/smud_survey.aspx";
		window.close();
	}
}

function surveyDone()
{
	setCookie();
}