// JavaScript Document



	
/* --------------------------------------------------------
	 Functions that go with Flash Movies.
 	 --------------------------------------------------------
*/

function OpenCableLocator(searchzip) {
	//Function written by Patriot Communications
   var myWindow = null;

   myWindow = window.open("http://www.click2locate.com/101/popbox.html","image0","resizable=no,toolbar=0,location=0,noresize,directories=0,status=0,menubar=0,scrollbars=1,copyhistory=0,width=580,height=660");
   myWindow.location = 'http://www.click2locate.com/101/default.asp?searchzip=' + searchzip + '&channels=41&action=findcarriers';
}


function showProgramsFloater(){
	var o;
	
	if(document.all && !document.getElementById){
		o = document.all['programsFloater'];
	}else{
		o = document.getElementById("programsFloater");
	}
	
	o.style.visibility = "visible";
}

function hideProgramsFloater(){
	var o;
	
	if(document.all && !document.getElementById){
		o = document.all['programsFloater'];
	}else{
		o = document.getElementById("programsFloater");
	}
	
	o.style.visibility = "hidden";
}

// --------------------------------------------------------



function launchWindow(url,name,w,h,options) {//v2.1
	if(options == null){options = 0};//In case options isn't passed set it to 0;
	if (document.all) {
		screenw = screen.width;
		screenh = screen.height;
		//Center the popup
		var leftPos = (screenw-w)/2;
		var topPos = (screenh-h)/2;
		
	} else {//Stupid netscape doesn't support this properly so they get top left instead
		var leftPos = 0;
		var topPos = 0;
	}
	
	if (options == 0){//Write a window with no options
		window.open(url,name,'width='+w+',height='+h+',resizable=no,scrollbars=no,toolbar=no,location=no,status=no,top=' + topPos + ',left=' + leftPos);
	} else if (options == 1) {//Write a window with options
		window.open(url,name,'width='+w+',height='+h+',resizable=yes,scrollbars=yes,toolbar=yes,location=yes,status=yes,top=' + topPos + ',left=' + leftPos);
	}

}

function SetCookie (name, value) {
	 var argv = SetCookie.arguments;
	 var argc = SetCookie.arguments.length;
	 var expires = (argc > 2) ? argv[2] : null;
	 var path = (argc > 3) ? argv[3] : null;
	 var domain = (argc > 4) ? argv[4] : null;
	 var secure = (argc > 5) ? argv[5] : false;
	 document.cookie = name + "=" + escape (value) +
	 ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
	 ((path == null) ? "" : ("; path=" + path)) +
	 ((domain == null) ? "" : ("; domain=" + domain)) +
	 ((secure == true) ? "; secure" : "");
}

function setPollCookie(poll_id) {
   var expdate = new Date ();
   expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 31));
   SetCookie ("poll_" + poll_id, 1, expdate, "/");
}

function getCookieVal(offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1) endstr = document.cookie.length;
   return unescape (document.cookie.substring(offset, endstr));
}

function GetCookie(name) {
   var arg = name+"=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg) return getCookieVal(j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break;
   }
   return null;
}

function getPollCookie(poll_id){
	return GetCookie("poll_" + poll_id);
}