	function ccgetCookieVal (offset) 
	{
		var endstr = document.cookie.indexOf (";", offset);
		if (endstr == -1)
			endstr = document.cookie.length;

		return unescape(document.cookie.substring(offset, endstr));
	}

	function CCGetCookie (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 ccgetCookieVal (j);
			
			i = document.cookie.indexOf(" ", i) + 1;

			if (i == 0) break; 
		}
		
		return null;
	}

	function CCWriteCookie (name, value, expires) 
	{
		var argv = CCSetCookie.arguments;
		var argc = CCSetCookie.arguments.length;
		var path = "/";
		var domain = (argc > 4) ? argv[4] : null;
		var secure = (argc > 5) ? argv[5] : false;
		
		var cookie = name + "=" + escape(value) +
			((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
			((path == null) ? "" : ("; path=" + path)) +
			((domain == null) ? "" : ("; domain=" + domain)) +
			((secure == true) ? "; secure" : "");
		
		document.cookie = cookie;
	}

	function CCDeleteCookie (name) 
	{
		var exp = new Date();
		exp.setTime (exp.getTime() - 1000000000);  // This cookie is history (changed -1 to make it previous time)
		var cval = CCGetCookie (name);
		document.cookie =name + "=" + cval + "; expires=" + exp.toGMTString();
	}

	function CCSetCookie(name, value, expiredays)
	{
		var expdate = new Date(); 
		expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * expiredays)); 
		CCWriteCookie(name, value, expdate);  
	}
	
	
	
	function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	
	function popUp(url) {
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=800,height=600');
	self.name = "mainWin";
	}
	
	
	function ourRates()
	{
		window.location.href = "General/Rates.aspx";
	}
	
	
	function showAffiliateProgram()
	{
		var win = window.open( "http://www.myaffiliateprogram.com/u/cashcall/affiliateProgram.html", "AffiliateProgram",'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=850,height=800');
		win.focus();
	}
	
	/*
	 * [NOR 4-17-06] Used in UCHomePage.ascx to externally embed Flash splash screen.
	 * Addresses CR 8832 (workaround for IE6 control activation)
	 */
	function embedFlashSplash(flashImageUrl, phoneText)
	{
		var flashinstalled = 0;
		var flashversion = 0;
		var MSDetect = "false";

		// Check to see if navigator.plugins exists and, if it exists, if its length is larger than zero.
		if (navigator.plugins && navigator.plugins.length)
		{
			// Check to see if flash plugin is installed
			x = navigator.plugins["Shockwave Flash"];
			if (x)
			{
				flashinstalled = 2;		// Flash is installed
				if (x.description)
				{
					y = x.description;
					flashversion = y.charAt(y.indexOf('.')-1);
				}
			}
			else
				flashinstalled = 1;
			if (navigator.plugins["Shockwave Flash 2.0"])
			{
				flashinstalled = 2;		// Flash is installed
				flashversion = 2;
			}
		}
		// If the plugins array is not supported, we see if the browser supports navigator.mimeTypes.
		else if (navigator.mimeTypes && navigator.mimeTypes.length)
		{
			x = navigator.mimeTypes['application/x-shockwave-flash'];
			if (x && x.enabledPlugin)
				flashinstalled = 2;		// Flash is installed
			else
				flashinstalled = 1;
		}
		else	// IE Flash detection
		{
			MSDetect = "true";
			for(var i=7; i>0; i--)
			{
				flashversion = 0;
				try
				{
					var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
					flashversion = i;
					flashinstalled = 2;
					break;
				}
				catch(e){}
			}
		}
			
		var showStaticImage = true;		

		if (flashinstalled == 2)
		{
			showStaticImage = false;
			
			// Who's Calling script, grabs and formats the dynamic number
			var src = flashImageUrl;
			var queries = "?phoneNumber="+phoneText;
			// Write the Flash file
			var flashSource = src + queries
			document.write('<object id="flashMain" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"\r\n' +
				'height="333" width="810" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" viewastext>\r\n' +
				'<param name="_cx" value="21431">\r\n' +
				'<param name="_cy" value="13018">\r\n' +
				'<param name="FlashVars" value="">\r\n' +
				'<param NAME="Movie" VALUE="' + flashSource + '">\r\n' +
				'<param NAME="Src" VALUE="' + flashSource + '">\r\n' +
				'<param name="WMode" value="Window"><param name="Play" value="-1"><param name="Loop" value="-1">\r\n' +
				'<param name="Quality" value="High"><param name="SAlign" value=""><param name="Menu" value="-1">\r\n' +
				'<param name="Base" value=""><param name="AllowScriptAccess" value="always"><param name="Scale" value="ShowAll">\r\n' +
				'<param name="DeviceFont" value="0"><param name="EmbedMovie" value="0"><param name="BGColor" value="">\r\n' +
				'<param name="SWRemote" value=""><param name="MovieData" value=""><param name="SeamlessTabbing" value="1">\r\n' +
				'<param name="Profile" value="0"><param name="ProfileAddress" value=""><param name="ProfilePort" value="0">\r\n');
			// if not IE or IE does not have plug-in
			if (MSDetect == "false" || flashversion == 0)
			{
				document.write('<embed src="' + flashSource + '"\r\n' +
				'quality="high" pluginspage="//www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="810"\r\n' +
				'height="333">\r\n</embed>\r\n');
			}
			document.write('</object>\r\n');
				
		}
		var tblStaticImage = document.getElementById( "tblStaticImage" );
		if (tblStaticImage != null && !showStaticImage)
		{
			tblStaticImage.style.display = "none";		//hide the static image
		}
	}
