var nowTime = new Date();
var nowDate = nowTime.getDate();
var nowHr = nowTime.getHours();
var nowMin = nowTime.getMinutes();
var outageHrOn = 00;
var outageMinOn = 00;
var outageHrOff = 01;
var outageMinOff = 00;
var outageDate = 20;
var outageTrigger = "ttt";
var outagePage = "/outage.html";
var outageTriggerGo = false;
var outageDateGo = false;
var outageHrGo = false;
var outageDone = false;
var outageMinGo = false;

if (window.location.href.indexOf(outageTrigger) >= 0){outageTriggerGo=true;};
if (outageDate == nowDate){outageDateGo=true;};
if (outageHrOn <= nowHr){outageHrGo=true;};
if ((outageHrOn == nowHr && outageMinOn <= nowMin) || (outageHrOn < nowHr)){outageMinGo=true;};
if ((outageHrOff == nowHr && outageMinOff <= nowMin) || (outageHrOff < nowHr)){outageDone=true;};

//alert(outageTriggerGo+"|"+outageDateGo+"|"+outageHrGo+"|"+outageMinGo+"|"+outageDone);
if(outageTriggerGo==true && outageDateGo==true && outageHrGo==true && outageMinGo==true && outageDone==false){location.replace(outagePage);};


//if(outageDate=="26"&&outageTime>=00&&outageTime<3){location.replace('/outage.html');};
//var pageLocation = window.location.href;
//if((window.location.href.indexOf(outageTrigger) >= 0)&& outageDate=="06"&&(outageTime>=00&&outageMin>=30)&&(outageTime<=12&&outageMin<=30)){location.replace('/outage.html');};
//var patt1=/upport/;
//var trigger=pageLocation.match(patt1);
//alert(pageLocation+"|"+patt1+"|"+trigger);
//if (trigger!=""){alert(pageLocation);};



var browser=navigator.appName
var browserVer=parseInt(navigator.appVersion)
if (browser=="ANT Fresco")
{
window.location = "http://webportal/sasktel/index.html";
}
if (navigator.userAgent.indexOf("Motorola VIP12xx") != -1)
{
  // I am the new HD Motorola set-top box!
  window.location = "http://webportal/sasktel/index.html";
}
if (browser=="Netscape"&&browserVer<5)
{
window.location.replace("http://www.sasktel.com/support/internet/upgrade.html");
}
sEstorePath = wStoreBasePath; //* the path to the Estore from web_path.js*
//sSearchPath = wSearchPath; //*from web_path.js*
sKnovaPath = wKnovaPath; //*from web_path.js*
sSaskTelPath = wSaskTelPath; //from web_path.js

//********************
//** Pop up windows **
//********************

var nW;
function mNW(pageName)  {
	URL='http://www.sasktel.com/Store/popups/' + pageName;
	//URL=sBaseURL + '/store/popups/' + pageName;
	pageNAME="popup";
	OPTIONS="Height=500,Width=550,scrollbars=1,toolbar=1,left=25,top=25";
	window.open(URL,pageNAME,OPTIONS);
	//nW = window.open(URL,pageNAME,OPTIONS);
}

function mnWFlash(winName)  {
	nW = window.open(sBaseURL + '/store/popups/' + winName,"","Height=430,Width=625,scrollbars=0,left=25,top=25");
}

//********************************************
//** Mobility Coverage map pop up window *****

function newWindow2() { window.open("http://www.sasktel.com/personal/mobility/coverage/interactive-coverage/coveragemaps.html","SaskTelMobilityPopup","WIDTH=456,HEIGHT=520");
}

function PopUpWindow(winurl, winname, winoptions){
	window.open(winurl, winname, winoptions);
}
//**********************************************************
//** Detect user session and direct to proper email form ***

function MailUs(){

	//Production:
	url= sEstorePath + "/eSales/start.swe?SWEScreen=SKTL+Email+Screen&SWENeedContext=false&SWETS=&SWECmd=GotoPageTab&SWEBID=-1&SWEC=20&SWEVST=-1";
	top.location = url;
	//Test
	//chooseMySaskTel("MailUs");
}

