//#########################//
// Scripts AMC Hildesheim  //
//#########################//

if(top.frames.length > 0)
top.location.href=self.location;


function naviover(obj){ 
	obj.style.background="#F3F3F3";
}
function naviout(obj){ 
	obj.style.background="";
	self.status = "";
}
function naviclick(obj,ref){ 
	obj.style.background="#FFFFFF";
	location=ref;
}

////////////////

function display_racelist() {
	racelist_status=!racelist_status;
	if (!racelist_status) {
		racelist.style.display='none';
		expandimage.src='http://amc.nxg-webcreation.de/img/int_expand_left.gif';
	}
	else {
		racelist.style.display='inline';
		expandimage.src='http://amc.nxg-webcreation.de/img/int_expand_right.gif';
	}
	
}

function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}

function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

function set_racelist_cookie(){
writeCookie("racelist_option",racelist_status, 1);
}


racelist_status=true;
if(readCookie("racelist_option")!="") racelist_status = readCookie("racelist_option");

///////////////////////

function view_pic(pic){
gal = window.open("http://amc.nxg-webcreation.de/view_pic.php?src=img/"+pic,"galerie","width=800,height=600,left=40, top=40, menubar, resizable, scrollbars");
gal.focus();
}

// Mail Crypt ----------------------------------------------------------------------------------------

function uncrypt(s) {	//
	var n=0;
	var r="";
	for(var i=0; i < s.length; i++) {
		n=s.charCodeAt(i);
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(5));
	}
	return r;
}



// uncrypt email and linkTo
  
function uncryptMail(s)	{	//
	location.href="mailto:"+uncrypt(s);
}