//click function for firefox
if(typeof HTMLElement!='undefined'&&!HTMLElement.prototype.click)
HTMLElement.prototype.click=function(){
var evt = this.ownerDocument.createEvent('MouseEvents');
evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
this.dispatchEvent(evt);
}

function getCookie(c_name) {
		if (document.cookie.length>0)
		  {
			  c_start=document.cookie.indexOf(c_name + "=");
			  if (c_start!=-1)
		  		{
				    c_start=c_start + c_name.length+1;
				    c_end=document.cookie.indexOf(";",c_start);
			  
			  if (c_end==-1) c_end=document.cookie.length;
		    		return unescape(document.cookie.substring(c_start,c_end));
		    	}
		  }
		return "";
}

function setCookie(name,value,expirehours) {
		var exdate=new Date();
		exdate.setTime(exdate.getTime()+(expirehours*60*60*1000));
		document.cookie=name+ "=" +escape(value)+
		((expirehours==null) ? "" : ";expires="+exdate.toGMTString());
}

function checkCookie() {
		invitation=getCookie('invitation');
		if (invitation!=null && invitation!="")
		  {

		  }
		else
		  {
			document.getElementById('layer_invitation').click();
			setCookie('invitation','elte',null);
			
		  }
}