//calling light box
function GB_showCenter(topname, url, w, h){
//	document.getElementById('mf_iframe').src="";
	if(url.substr(0,6)!="../../"){
		var newurl=url;
	} else {
	var newurl=url.substr(6);
	}
	mainfloatboxfunc(100, newurl,w,h);
	
}


//active the light box
function mainfloatboxfunc(margintw,url,w,h){
	//check album display
	if(document.getElementById('album_playbox')!=null){
	document.getElementById('album_playbox').style.display='none';
	}
	//float light box

	document.getElementById('main_fbox').style.display='block';
	if(w==undefined || w=='' || w> document.documentElement.clientWidth){
					document.getElementById('main_fcontent').style.width=(document.getElementById('main_fbox').scrollWidth-margintw)+"px";
	} else {
					document.getElementById('main_fcontent').style.width=w+"px";
	}
	if(h==undefined || h=='' ||  h>document.documentElement.clientHeight){
		document.getElementById('main_fcontent').style.top=margintw/2+"px";
		document.getElementById('main_fcontent').style.height=(document.documentElement.clientHeight-margintw)+"px";
		document.getElementById('mf_iframe').style.height=(document.getElementById('main_fcontent').scrollHeight-margintw/2-2)+"px";
	} else {
		document.getElementById('main_fcontent').style.top=(document.documentElement.clientHeight-h)/2+"px";
		document.getElementById('main_fcontent').style.height=h+"px";
		document.getElementById('mf_iframe').style.height=(h-margintw/2-2)+"px";
	}
	document.getElementById('mf_iframe').src=url;
	/* checking status
	if(window.location.pathname.lastIndexOf('site_test')!=-1){
		alert(w+","+document.documentElement.clientWidth);
		var tmpmargin=margintw/2+"px";
		var tmpclientHeight=(document.documentElement.clientHeight-margintw)+"px";
		var tmpclientwidth=(document.getElementById('main_fbox').scrollWidth-margintw)+"px";
		alert("clientheight="+document.documentElement.clientHeight+"\nmargin="+tmpmargin+"\nheight="+tmpclientHeight+"\nwidth="+tmpclientwidth);
	}*/
//	mfc_update(var,var2)
}

//ajax //////////////////
/*
function mfc_update(){
		var pingTo = 'delete_sub_item.php';
		var xhConn = new XHConn();

		xhConn.connect(pingTo, "GET", "item_type="+item_type+"&item_id="+item_id,
			function (xh)
			{	 
				document.getElementById(div).innerHTML = xh.responseText;
			}
		);
}

*/


//close the light box
function box_close(){
	if(document.getElementById('album_playbox')!=null){
	document.getElementById('album_playbox').style.display='block';
	}
	document.getElementById('main_fbox').style.display='none';
	document.getElementById('mf_iframe').src="";
}

//viewing requirement light box
function requirement_box(){
	document.getElementById('main_fcontent_req').style.top=(document.documentElement.clientHeight-213)/2+"px";
	document.getElementById('main_fbox_req').style.display='block';
}

function box_req_close(){
	document.getElementById('main_fbox_req').style.display='none';
}