// JavaScript Document

function getCookie(key){
  tmp=document.cookie;
  cutKey=tmp.indexOf(key,0);
  if(cutKey!=-1){
    tmp=tmp.substring(cutKey,tmp.length);
    start=tmp.indexOf("=",0)+1;
    end=tmp.indexOf(";",start);
    return(tmp.substring(start,end));
  }
  return("");
}

function checkPage(){
	if(getCookie('pass')!=pwo){
		document.cookie="uri="+escape(location.href)+";";
		document.cookie="c1=1;";
		location.href="/";
	}
}

function Login(){
  document.cookie="pass="+document.login.pw.value+";path=/;expires=01-01-2020 12:00:00;";
	location.href="passcheck.php";
}

function openPass(x){
	return(x);
}

function writePass(){
	document.write(document.cookie+"<br />"+getCookie('pass')+"<br />"+getCookie('uri'));
}

