function setCookie(name, value, expire) {

document.cookie = name + "=" + escape(value)

+ ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))

}

function getCookie(Name) {
var search = Name + "="
if (document.cookie.length > 0) { // if there are any cookies
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset)

// set index of end of cookie value

if (end == -1)
end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
}
}



function register(name) {
var today = new Date()
var expires = new Date()
expires.setTime(today.getTime() + 1000*60*60*24*365)
setCookie("footer_hide_cookie", name, expires)
}

var yourname = getCookie("footer_hide_cookie")

if (yourname == null)
{
register("show");
}



function hide_footer()
{
register("hide");
document.getElementById('hide_f').style.display='none';
document.getElementById('show_f').style.display='';
slideup('footer_hide');
}

function show_footer()
{
register("show");
document.getElementById('show_f').style.display='none';
document.getElementById('hide_f').style.display='';
slidedown('footer_hide');
}



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 isEMail(str) {
	
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		     return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   	   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		       return false
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		   	    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		       return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		        return false
		 }
		 if (str.indexOf(" ")!=-1){
		       return false
		 }
 		 return true					
	}


