function ClearText() {
	var itxt =  _proxy_jslib_handle(document, 'getElementsByTagName', '', 1, 0)("input");
	for(var i = 0; i <itxt.length; i++)
		{
			if( _proxy_jslib_handle(itxt, (i), 0, 0).className == 'searchtext')
			{
				if( _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)( _proxy_jslib_handle(itxt, (i), 0, 0).id), 'value', '', 0, 0) == "Enter City or US Zip")	
					 _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)( _proxy_jslib_handle(itxt, (i), 0, 0).id), 'value', '=', ( ''));
			}
		}
}

function toggletab(thetab) {
    	if ( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("radar"))  _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("radar").style, 'backgroundImage', '=', ( "url(http://x.MySpace.com/Images/Weather/tab-off.gif)"));
		if ( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("satellite"))  _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("satellite").style, 'backgroundImage', '=', ( "url(http://x.MySpace.com/Images/Weather/tab-off.gif)"));
		if ( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("temps"))  _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("temps").style, 'backgroundImage', '=', ( "url(http://x.MySpace.com/Images/Weather/tab-off.gif)"));
		if ( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("surface"))  _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("surface").style, 'backgroundImage', '=', ( "url(http://x.MySpace.com/Images/Weather/tab-off.gif)"));
		if ( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(thetab))  _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(thetab).style, 'backgroundImage', '=', ( "url(http://x.MySpace.com/Images/Weather/tab-on.gif)"));
		var idiv =  _proxy_jslib_handle(document, 'getElementsByTagName', '', 1, 0)("div"); 
		 for( var i = 0; i < idiv.length; i++ ) 
		 { 
			if(  _proxy_jslib_handle(idiv, (i), 0, 0).className == 'divMaps' ) 
				  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)( _proxy_jslib_handle(idiv, (i), 0, 0).id).style.display = "none";
			if(thetab == "radar" &&  _proxy_jslib_handle(idiv, (i), 0, 0).id.indexOf(thetab) != -1)	 
				  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)( _proxy_jslib_handle(idiv, (i), 0, 0).id).style.display = "inline";
			if(thetab == "satellite" &&  _proxy_jslib_handle(idiv, (i), 0, 0).id.indexOf(thetab) != -1)	 
				  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)( _proxy_jslib_handle(idiv, (i), 0, 0).id).style.display = "inline";
			if(thetab == "temps" &&  _proxy_jslib_handle(idiv, (i), 0, 0).id.indexOf(thetab) != -1)	 
				  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)( _proxy_jslib_handle(idiv, (i), 0, 0).id).style.display = "inline";
			if(thetab == "surface" &&  _proxy_jslib_handle(idiv, (i), 0, 0).id.indexOf(thetab) != -1)	 
				  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)( _proxy_jslib_handle(idiv, (i), 0, 0).id).style.display = "inline";
		 }	
	}

function TrimWhiteSpace(str) {  while(str.charAt(0) == (" ") )
  {  str = str.substring(1);
  }
  while(str.charAt(str.length-1) == " " )
  {  str = str.substring(0,str.length-1);
  }
  return str;
}
function Trimcommas(str) {
	while(str.charAt(0) == (","))
	{
		str = str.substring(1);
	}
	while(str.charAt(str.length-1) == "," )
	{  
		str = str.substring(0,str.length-1);
	}	
	
  return str;
}
function CheckNumOrChar(source, e, id) {
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	if(keycode == 13)
		{
			if(document.form)
				document.form.submit();
		}
	else
		{
			var numbers = "1234567890";
			var loc;	var n = 1;	var cleanstring;
			cleanstring = TrimWhiteSpace( _proxy_jslib_handle(source, 'value', '', 0, 0));
			cleanstring = Trimcommas(cleanstring);
			var ilen = cleanstring.length;
			loc = numbers.indexOf(cleanstring.substring(ilen, ilen-n));
			if( _proxy_jslib_handle(source, 'value', '', 0, 0).length > 0 && keycode != 0 && keycode != 46)
			{
				if (loc != -1)
				{
					if ((((keycode>47) && (keycode<58)) || (keycode == 46)) || (keycode==8) || (keycode==32)) { return true; }
					else { return false;}
				}
				else
				{
					if ((((keycode>64) && (keycode<91)) ||((keycode>96) && (keycode<123)) || (keycode == 46))|| (keycode==32) || (keycode==8)|| (keycode==44)) { return true; }
					else { return false;}
				}
			}
			else if( _proxy_jslib_handle(source, 'value', '', 0, 0).length == 0)
			{
				if(((keycode>64) && (keycode<91)) || ((keycode>96) && (keycode<123)) || ((keycode>47) && (keycode<58)) ||(keycode == 0))return true;
				else {return false;}
			}
			else{if(keycode == 0) return true;
			else return false;}
		}
}

function checkSpecialChar(id) {
	
	var regexp = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";
	for (var i = 0; i <  _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id), 'value', '', 0, 0).length; i++) 
	{
  		if (regexp.indexOf( _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(id), 'value', '', 0, 0).charAt(i)) != -1) 
  		{
  		alert ("Your Search has special characters. \n Please remove them and try again.");
  		return false;
  		}
  	}
 } ;
_proxy_jslib_flush_write_buffers() ;