/***********************************************
* This notice must stay intact for use
* Authoried by Mr. Sruy Len
***********************************************/
function read_content(ind_content,id){
	if (ind_content=="''"){
		ind_content=get_datacookie(document.cookie,"selected_id");
		}
	if (document.getElementById(id)) {
		var objdiv=document.getElementById(id);		
		objdiv.innerHTML=content[ind_content];
	
		var objspan=document.getElementById(id+"tittle");
		objspan.innerHTML=text_tittle[ind_content];
		
		
		if (ind_content!="''"){ select_item(ind_content); }
		document.cookie = "selected_id="+ind_content;
	}
	else {
		document.cookie = "xxxid="+ind_content;
		location.href="detail_place.php";
	}
	
}
var bol=false;
function select_item(selecting_id){
	var selected_id=get_datacookie(document.cookie,"selected_id");
	if (selected_id!="" && selected_id!="''") {
		document.getElementById(selected_id).style.textDecoration = "";
		document.getElementById(selected_id).style.fontWeight = "normal";		
		document.getElementById("selected_image").style.display="none";
	}
	document.getElementById(selecting_id).style.textDecoration = "underline";
	document.getElementById(selecting_id).style.fontWeight = "bold";
	document.getElementById("selected_image").style.left=caloffset(document.getElementById(selecting_id), "left")-17+"px";
	if (bol==false){
		document.getElementById("selected_image").style.top=caloffset(document.getElementById(selecting_id), "top")+23+"px";

		bol=true;
	}else{
		document.getElementById("selected_image").style.top=caloffset(document.getElementById(selecting_id), "top")+"px";
	}
	document.getElementById("selected_image").style.display="block";

}


function get_datacookie(cookie_data,username){
	var arr=cookie_data.split(";");
	for (i=0; i<arr.length; i++){
		var arrcookie=arr[i].split("=");
		if (arrcookie[0].replace(" ","")==username) return arrcookie[1];
	}
	return "";
}
