		function trim(s) {
		  while (s.substring(0,1) == ' ') {
		    s = s.substring(1,s.length);
		  }
		  while (s.substring(s.length-1,s.length) == ' ') {
		    s = s.substring(0,s.length-1);
		  }
		  return s;
		}
		
	
		function openWeather(){
			PopupMetlineWeather();
			//window.open('http://www.metline.com/prods/metline_golfweather.php?id=102', '_blank', 'height=420,width=470,menubar=no,scrollbars=no,toolbar=no,location=no,status=no,resizable=yes');
		}

		function openNews(){
			window.open('news.php', '_blank', 'location=0,toolbar=0,width=400,height=350,resizable=1,scrollbars=1');
		}
		
		function PopSki(){
			window.open('http://www.metline.com/prods/metline_skiweather.php?id=146', '_blank', 'location=0,toolbar=0,width=490,height=426,resizable=0,scrollbars=0');
		}
		
		function validEmail(){
			var email = trim(arguments[0]);
			if(email == ''){
				return false;
			}
			if(email.indexOf('@') == -1){
				return false;
			}
			if(email.indexOf('.') == -1){
				return false;
			}
			if(email.lastIndexOf('.') < email.lastIndexOf('@')){
				return false;
			}
			if(email.lastIndexOf('.') == (email.length - 1)){
				return false;
			}
			if((email.indexOf('@')) != (email.lastIndexOf('@'))){
				return false;
			}
			
			
			return true;
		}
