function showPopUp(){
	var popUpContent
	popUpContent ='<div id="popupwindow"><div class="top-border">&nbsp;</div><div class="padding"><div class="content"><strong>WARNING:</strong> The page you have requested contains nudity. If you are offended by such material or are not at least 18 years of age, please click on the CANCEL button now.<br /><br /><br /></div><div id="pop_enter" class="button" onclick="javascript:enterin();">Enter</div><div id="pop_close" class="button" onclick="javascript:closeme();">Cancel</div></div></div><div id="outter"></div>';
	var bodyContent = document.getElementsByTagName("body")[0].innerHTML
	//bodyContent = popUpContent + bodyContent
	//document.getElementsByTagName("body")[0].innerHTML = bodyContent
	document.getElementsByTagName("body")[0].innerHTML = bodyContent + popUpContent
}
function checkCertificate()
{
	var CC = getCookie('certificate_check');
      if("certified" != CC ){
		showPopUp()
		if(document.all){
		    document.getElementById("outter").style.height = document.body.scrollHeight
		   }
		else {
			document.getElementById("outter").style.height = document.height
		  }
		
		
		
		document.getElementById("outter").style.display = "inline"
	  }
}

function getCookie(cookieName){
if (document.cookie.length>0)
  {
  var cookieValue=document.cookie.indexOf(cookieName + "=");
  if (cookieValue!=-1)
    {
    cookieValue=cookieValue + cookieName.length+1;
    c_end=document.cookie.indexOf(";",cookieValue);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(cookieValue,c_end));
    }
  }
return "";
}

function setCookie(cookieName,value,expiredays){
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=cookieName+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
 
function closeme(){	
	location.replace("../index.html")
} 

function enterin(){
	document.getElementById('outter').style.display = "none"
	document.getElementById('popupwindow').style.display = "none"
	
	setCookie("certificate_check", "certified")
}
