function refCheck() {
	var refFlag = document.domain;
	var refValue = document.referrer.split("/",3);
	if(refFlag == refValue) {
  	return true;
  } else {
  	return false;
  }
}

function checkAccess() {
	var cookieValue = cookieObj.getCookie('access');

	if(!refCheck() && !arguments[0]) {
		switch(cookieValue) {
			case "" : writeHTML(); document.location.href="index_html.php"; break;
			case "fla" : break;
			case "html" :document.location.href="index_html.php"; break;
			default : break;
		}
	} else if(!refCheck() && arguments[0]) {
		switch(cookieValue) {
			case "" : writeFLA(); break;
			case "fla" : break;
			case "html" :document.location.href="index_html.php"; break;
			default : break;
		}
	}
}

/* write cookie [access] - fhash page */
	function writeFLA() {
		cookieObj.setCookie('access','fla','/');
	}

/* write cookie [access] - html page */
	function writeHTML() {
		cookieObj.setCookie('access','html','/');
	}


