// Hiermenus related script

if(window.event + "" == "undefined") event = null;

function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;


function popIt(pop) {
	var aWindow = window.open('','pope','width=570,height=350,scrollbars=1,resizable=1,top=0,left=0');

	aWindow.location=pop;
        aWindow.focus();
}

function popWin(pop, w, h) {
	var clwidth = w
        var clheight = h

	var aWindow = window.open('','pope','width=' + clwidth + ',height=' + clheight + ',top=0,left=0');
		aWindow.location=pop;
        aWindow.focus();
}


function popItToo(pop) {
	var aWindow = window.open('','pope','width=800,height=480,scrollbars=1,resizable=1,top=0,left=0');
		aWindow.location=pop;
        aWindow.focus();
}


function popWin2(pop, w, h) {
	var clwidth = w
        var clheight = h

	var aWindow = window.open('','pope','width=' + clwidth + ',height=' + clheight + ',top=350,left=400');
		aWindow.location=pop;
        aWindow.focus();
}

function popWin3(pop, w, h) {
	var clwidth = w
        var clheight = h
	var aWindow = window.open('','pope','width=' + clwidth + ',height=' + clheight + ',top=150,left=300');
		aWindow.location=pop;
        	aWindow.focus();

}

function popWin4(pop, w, h) {
	var clwidth = w
        var clheight = h

	var aWindow = window.open('','pope','width=' + clwidth + ',height=' + clheight + ',scrollbars=1,resizable=1, 		top=0,left=0');
		aWindow.location=pop;
        aWindow.focus();
}

<!--
// Copyright Acro Media Inc. 1998-2005, www.acromediainc.com
var newWindow;

function openUp(windowURL, windowWidth, windowHeight){
  var topPos = "";
  var leftPos = "";
  if(!windowWidth) windowWidth = 0;
  if(!windowHeight) windowHeight = 0;
  if(windowWidth == 0){
    if(screen){
      windowWidth = screen.availWidth -10;
    }
    else{
      windowWidth = 790;
    }
    leftPos = ",left=0";
  }
  if(windowHeight == 0){
    if(screen){
      windowHeight = screen.availHeight -30;
    }
    else{
      windowHeight = 790;
    }
    topPos = ",top=0";
  }

  newWindow = window.open(windowURL,"telusmobility","toolbar=no,menubar=0,width="+windowWidth+",height="+windowHeight+topPos+leftPos+",scrollbars=yes,resizable=yes");

  setTimeout('newWindow.focus();',100);
}

// -->

var favorite = getCookie('province');

var favorite1 = getCookie('product');


// TELUS' getCookie returns null if the cookie is blank, ours returns 0, check for 0 then set to null
if(favorite == 0){
	favorite = null;
}
if(favorite1 == 0){
	favorite1 = null;
}

function setProvince(which,whom,storefront){
	url = "http://www.telusmobility.com";

	//not all calls send a storefront, so if it wasn't sent, initialize it
	if(storefront == null){
		storefront = "";
	}

	if(which =="prod"){      // products locations
		if(favorite != null) {
			switch (favorite) {
				case 'bc' : 	url += '/bc/' + whom + 'index.shtml'; // change these!
						break;

				case 'ab' : 	url += '/ab/' + whom + 'index.shtml';
						break;

				case 'sk' :     url += '/sk/' + whom + 'index.shtml';
						break;

				case 'mb' : 	url += '/mb/' + whom + 'index.shtml';
						break;

				case 'on' : 	url += '/on/' + whom + 'index.shtml';
						break;

				case 'qc' :     url += '/qc/' + whom + 'index.shtml';
						break;

				case 'nb' :     url += '/nb/' + whom + 'index.shtml';
						break;

				case 'nf' :     url += '/nf/' + whom + 'index.shtml';
						break;

				case 'pei' :    url += '/pei/' + whom + 'index.shtml';
						break;

				case 'ns' :     url += '/ns/' + whom + 'index.shtml';
						break;
			}
			window.location.href = url;
		}
		else {
			url+="/" + which + "province.html?" + whom;
			popIt(url);
		}

	}

	if(which =="store"){     // webstore locations
		if (favorite != null) {
			url = "http://store.telusmobility.com/";
			if(storefront != "" && storefront != null){
				url += storefront + "/";
			}
			url += favorite + "/index.htm";
			window.location.href = url;
		}
		else {
			url+="http://store.telusmobility.com/" + which + "province.html";
			popIt(url);
		}
	}

	url = "http://www.telusmobility.com";

	if(which =="cc") {      // clientcare locations
		if ((favorite != null) && (favorite1 != null) && (favorite1 != "NULL")) {

			switch (favorite) {
				case 'bc' :
					switch (favorite1) {
						case 'dpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						case 'pt' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'anl' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						case 'mk' :
							if(whom=="cc")
								url += '/clientcare/mike/index.shtml';
							else
								url += '/clientcare/mike/' + whom + '_home.shtml';
							break;

						case 'pg' :
							if((whom=="cc")||(whom=="selfserve")||(whom=="network_features"))
								url += '/clientcare/paging/index.shtml';
							else
								url += '/clientcare/paging/' + whom + '_home.shtml';
							break;

						case 'epcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						case 'wpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						case 'ept' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'asat' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/autotel_home.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						default : 	url += '/index.shtml';
								popIt("/ccprovince.htm");
							break;
					}
					break;

				case 'ab' :
					switch (favorite1) {
						case 'dpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						case 'pt' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'anl' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						case 'mk' :
							if(whom=="cc")
								url += '/clientcare/mike/index.shtml';
							else
								url += '/clientcare/mike/' + whom + '_home.shtml';
							break;

						case 'pg' :
							if((whom=="cc")||(whom=="selfserve")||(whom=="network_features"))
								url += '/clientcare/paging/index.shtml';
							else
								url += '/clientcare/paging/' + whom + '_home.shtml';
								break;

						case 'epcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
								break;

						case 'wpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
								break;

						case 'ept' :
								if((whom=="cc")||(whom=="selfserve"))
							url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
								break;

						case 'asat' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/autotel_home.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
								break;

						default : 	url += '/index.shtml';
							popIt("/ccprovince.htm");
							break;
					}
					break;

				case 'sk' :
					switch (favorite1) {
						case 'dpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						case 'pt' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'anl' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						case 'epcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						case 'wpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						case 'ept' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						default : 	url += '/index.shtml';
							popIt("/ccprovince.htm");
							break;
					}
					break;

				case 'mb' :
					switch (favorite1) {
						case 'dpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'epcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'wpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'ept' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'pt' :
								if((whom=="cc")||(whom=="selfserve"))
							url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'mk' :
							if(whom=="cc")
								url += '/clientcare/mike/index.shtml';
							else
								url += '/clientcare/mike/' + whom + '_home.shtml';
							break;

						default : 	url += '/index.shtml';
							popIt("/ccprovince.htm");
							break;
					}
					break;

				case 'on' :
					switch (favorite1) {
						case 'dpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'pt' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'mk' :
							if(whom=="cc")
								url += '/clientcare/mike/index.shtml';
							else
								url += '/clientcare/mike/' + whom + '_home.shtml';
							break;

						case 'epcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

					case 'wpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'ept' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						default : 	url += '/index.shtml';
							popIt("/ccprovince.htm");
							break;
					}
					break;

				case 'qc' :
					switch (favorite1) {
						case 'dpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'pt' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'anl' :
							if(whom=="cc")
								url += '/clientcare/pcs_west/index.shtml';
							else
								url += '/clientcare/pcs_west/' + whom + '_home.shtml';
							break;

						case 'mk' :
							if(whom=="cc")
								url += '/clientcare/mike/index.shtml';
							else
								url += '/clientcare/mike/' + whom + '_home.shtml';
							break;

						case 'qt' : 	url += '/clientcare/quebectel/index.shtml';
								break;

						case 'epcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'wpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'ept' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						default : 	url += '/index.shtml';
							popIt("/ccprovince.htm");
							break;
					}
					break;

				case 'ns' :
					switch (favorite1) {
						case 'dpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'pt' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'epcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'wpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'ept' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						default : 	url += '/index.shtml';
							popIt("/ccprovince.htm");
							break;
					}
					break;

				case 'nb' :
					switch (favorite1) {
						case 'dpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'pt' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'epcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'wpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'ept' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						default : 	url += '/index.shtml';
							popIt("/ccprovince.htm");
							break;
					}
					break;

				case 'nf' :
					switch (favorite1) {
						case 'dpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'pt' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'epcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'wpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'ept' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						default : 	url += '/index.shtml';
							popIt("/ccprovince.htm");
							break;
					}
					break;

				case 'pei' :
					switch (favorite1) {
						case 'dpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'pt' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						case 'epcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'wpcs' :
							if(whom=="cc")
								url += '/clientcare/pcs_east/index.shtml';
							else
								url += '/clientcare/pcs_east/' + whom + '_home.shtml';
							break;

						case 'ept' :
							if((whom=="cc")||(whom=="selfserve"))
								url += '/clientcare/payandtalk/index.shtml';
							else
								url += '/clientcare/payandtalk/' + whom + '_home.shtml';
							break;

						default : 	url += '/index.shtml';
							popIt("/ccprovince.htm");
							break;
					}
					break;
			}
			window.location.href = url;
		}
		else {
			if(whom=="cc"){
				url+="/" + which + "province.html";
			}
			else{
				url+="/" + which + "province.html?" + whom;
			}
			popIt(url);
		}
	}
}

// This function redirects every selection of autotel from the nav bar
// to the PCS West Autotel Client Care Home page
function setSpecialProvince(which){
	url = "http://www.telusmobility.com";
	if(which =="Autotel"){      // products locations
		if (favorite != null) {
			switch (favorite) {
				case 'bc' : 	url += '/bc/autotel_home.shtml'; // change these!
	     			break;
				case 'ab' : 	url += '/ab/autotel_satellite.shtml';
					break;
				case 'sk' :     url += '/sk/autotel_satellite.shtml';
					break;
				case 'mb' : 	url += '/mb/autotel_satellite.shtml';
					break;
				case 'on' : 	url += '/on/autotel_satellite.shtml';
					break;
				case 'qc' :     url += '/qc/autotel_satellite.shtml';
					break;
				case 'nb' :     url += '/nb/autotel_satellite.shtml';
					break;
				case 'nf' :     url += '/nf/autotel_satellite.shtml';
					break;
				case 'pei' :     url += '/pei/autotel_satellite.shtml';
					break;
				case 'ns' :     url += '/ns/autotel_satellite.shtml';
					break;
			}
			window.location.href = url;
		}
		else {
			url+="/clientcare/pcs_west/autotel_home.shtml";
			window.location.href = url;
		}
	}
}

function setAnyProvince(stringtobreak){

	url = "http://www.telusmobility.com";
	if (favorite != null) {

	// Breaks stringtobreak by the ',' and stores it in the pathstring array
		var pathstring = stringtobreak.split(',');

		switch (favorite) {
			case 'bc' :
				if (pathstring[0] == "oneurl") {
					url += '/bc' + pathstring[1];
				} else {
					if (pathstring [0] == "multiurl") {
						url += pathstring[1];
					}
				}
				break;
			case 'ab' :
				if (pathstring[0] == "oneurl") {
					url += '/ab' + pathstring[1];
				} else {
					if (pathstring [0] == "multiurl") {
						url += pathstring[2];
					}
				}
				break;
			case 'sk' :
				if (pathstring[0] == "oneurl") {
					url += '/sk' + pathstring[1];
				} else {
					if (pathstring [0] == "multiurl") {
						url += pathstring[3];
					}
				}
				break;
			case 'mb' :
				if (pathstring[0] == "oneurl") {
					url += '/mb' + pathstring[1];
				} else {
					if (pathstring [0] == "multiurl") {
						url += pathstring[4];
					}
				}
				break;
			case 'on' :
				if (pathstring[0] == "oneurl") {
					url += '/on' + pathstring[1];
				} else {
					if (pathstring [0] == "multiurl") {
						url += pathstring[5];
					}
				}
				break;
			case 'qc' :
				if (pathstring[0] == "oneurl") {
					url += '/qc' + pathstring[1];
				} else {
					if (pathstring [0] == "multiurl") {
						url += pathstring[6];
					}
				}
						break;
			case 'nb' :
				if (pathstring[0] == "oneurl") {
					url += '/nb' + pathstring[1];
				} else {
					if (pathstring [0] == "multiurl") {
						url += pathstring[7];
					}
				}
					break;
			case 'nf' :
				if (pathstring[0] == "oneurl") {
					url += '/nf' + pathstring[1];
				} else {
					if (pathstring [0] == "multiurl") {
						url += pathstring[8];
					}
				}
					break;
			case 'pei' :
				if (pathstring[0] == "oneurl") {
					url += '/pei' + pathstring[1];
				} else {
					if (pathstring [0] == "multiurl") {
						url += pathstring[9];
					}
				}
					break;
			case 'ns' :
				if (pathstring[0] == "oneurl") {
					url += '/ns' + pathstring[1];
				} else {
					if (pathstring [0] == "multiurl") {
						url += pathstring[10];
					}
				}
					break;
		}
		window.location.href = url;
	}
	else {
		url+="/anyprovince.html?" + stringtobreak;
		popIt(url);
	}
}


function maketop(){
	if(window != top){
		if(top.location){
			top.location.href=location.href;
		}
	}
}


maketop();
