<?php
session_start();
if (session_is_registered("userInfo")){
	$selectedLanguage=$userInfo[language];
	$language=$userInfo[language];
}

require("../../inc/lib.inc");
require("../sub_inc/sub_config.inc"); 

$session_timeout=getPubVar("HTTPSessionTimeout")-0;
if($session_timeout == 0)
	$session_timeout=15*60;
else
	$session_timeout=$session_timeout*60;

$if_pass=pageAccessChk($PHP_SELF);
if($if_pass < 0){
	echo "<script language=\"javascript\">";
	echo "var logon='Please Logon System';";  
	echo "alert(logon);";
	echo "window.parent.parent.location.href=\"../../security/logout/logout.php\";";
	echo "</script>";
	exit();
}

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");

if($selectedLanguage == 'chn'){
?>
	<html>
	<style type="text/css">
	<!--
	body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt;}
	th   { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: bold; background-color: #D3DCE3;}
	td   { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt;}
	form { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt}
	textarea{font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; BACKGROUND-COLOR: white; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid;}
	input.text {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; BACKGROUND-COLOR: white; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid;}
	input.button {font-family: Verdana; font-size: 9pt}
	select {font-size: 9pt; BACKGROUND-COLOR: white;}
	h1   { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16pt; font-weight: bold}
	A:link    { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; text-decoration: none; color: #0000FF}
	A:visited { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; text-decoration: none; color: #0000FF}
	A:hover   { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; text-decoration: underline; color: #FF0000}
	A:link.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #0000FF}
	A:visited.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #0000FF}
	A:hover.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FF0000}
	.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000}
	#leftMargin {position:absolute;left:0px;top:0px;BACKGROUND-IMAGE: url(../../images/background_main_L.gif);BACKGROUND-REPEAT: repeat-y;}
	#rightMargin {position:absolute;right:0px;top:0px;BACKGROUND-IMAGE: url(../../images/background_main_R.gif);BACKGROUND-REPEAT: repeat-y;}
	#mainContent {position:absolute;left:0px;top:0px;BACKGROUND-IMAGE: url(../../images/background_main_M.gif);BACKGROUND-REPEAT: repeat-x;}
	-->
	</style>
<?php
}else{
?>
	<html>
	<style type="text/css">
	<!--
	body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt;}
	th   { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: bold; background-color: #D3DCE3;}
	td   { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt;}
	form { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt}
	textarea{font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; BACKGROUND-COLOR: white; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid;}
	input.text {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; BACKGROUND-COLOR: white; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid;}
	input.button {font-family: Verdana; font-size: 8pt}
	select { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; BACKGROUND-COLOR: white; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid;}
	h1   { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16pt; font-weight: bold}
	A:link    { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; text-decoration: none; color: #0000FF}
	A:visited { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; text-decoration: none; color: #0000FF}
	A:hover   { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; text-decoration: underline; color: #FF0000}
	A:link.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #0000FF}
	A:visited.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #0000FF}
	A:hover.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FF0000}
	.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000}
	#leftMargin {position:absolute;z-index:100;left:0px;top:0px;BACKGROUND-IMAGE: url(../../images/background_main_L.gif);BACKGROUND-REPEAT: repeat-y;}
	#rightMargin {position:absolute;z-index:100;right:0px;top:0px;BACKGROUND-IMAGE: url(../../images/background_main_R.gif);BACKGROUND-REPEAT: repeat-y;}
	#mainContent {position:absolute;left:10px;top:0px;right:0px;bottom:0px;BACKGROUND-IMAGE: url(../../images/background_main_M.gif);BACKGROUND-REPEAT: repeat-x;}

	-->
	</style>
<?php
}	
?>
<script LANGUAGE="JavaScript">
function openHelp(helpId){
	URL="../../omcHelp/index.php?helpId="+helpId;
	var baseSetting='toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,left=0,top=0';
	var size800=',width=790,height=560';
	var size1024=',width=1010,height=710';
	if (window.screen.width==800 && window.screen.height==600){
		pageSetting = baseSetting + size800;
	}else{
		pageSetting = baseSetting + size1024;
	}
	msgWindow = window.open(URL,'helpWin',pageSetting);
	msgWindow.focus();
}

function adjust()
{
	var offsetW=document.body.offsetWidth;
	var offsetH=document.body.offsetHeight;
	var scrollH=document.body.scrollHeight;
	var scrollW=document.body.scrollWidth;
	var clientH=document.body.clientHeight;
	var clientW=document.body.clientWidth;
	
	var browserr = navigator.appName;
	if(browserr == "Microsoft Internet Explorer")
	{
		document.getElementById('img_up').width=offsetW;
		document.getElementById('img_up').height=75;
		
		document.getElementById('img_down').width=offsetW;
		document.getElementById('img_down').height=offsetH;
		
		document.getElementById('content_down').style.width=offsetW-20;
		document.getElementById('content_down').style.height=offsetH-75;
	}
	else
	{
		//alert('offsetH='+offsetH+',scrollH='+scrollH+',clientH='+clientH);
		document.getElementById('img_up').width=offsetW+23;
		document.getElementById('img_up').height=75;
		
		document.getElementById('img_down').width=offsetW+23;
		document.getElementById('img_down').height=clientH;
		document.getElementById('img_down').style.top='175px';
		document.getElementById('img_down').style.left='0px';
		
		document.getElementById('div_down').style.top='75px';
		document.getElementById('div_down').style.bottom='500px';
		
		document.getElementById('content_down').style.width=offsetW+5;
		document.getElementById('content_down').style.height=clientH-75;
		
		document.getElementById('table_up').width=offsetW;
	}
	//add this style to body
	//leftmargin="15" rightmargin="10"
	//overflow:hidden;overflow-x:hidden;overflow-y:hidden;
}

//-------------from frame window--------------------
function adjust_frame(flag)
{
	
	var offsetW=document.body.offsetWidth;
	var offsetH=document.body.offsetHeight;
	var scrollH=document.body.scrollHeight;
	var scrollW=document.body.scrollWidth;
	var clientH=document.body.clientHeight;
	var clientW=document.body.clientWidth;
	
	var browserr = navigator.appName;
	if(browserr == "Microsoft Internet Explorer")
	{


		document.getElementById('img_up').width=offsetW;
		document.getElementById('img_up').height=75;
		
		document.getElementById('img_down').width=offsetW;
		document.getElementById('img_down').height=offsetH;
		
		document.getElementById('content_down').style.width=offsetW-20;
		document.getElementById('content_down').style.height=offsetH;

	}
	else
	{
		//alert('offsetH='+offsetH+',scrollH='+scrollH+',clientH='+clientH);
		document.getElementById('img_up').width=offsetW+23;
		document.getElementById('img_up').height=75;
		
		document.getElementById('img_down').width=offsetW+23;
		document.getElementById('img_down').height=clientH;
		document.getElementById('img_down').style.top='175px';
		document.getElementById('img_down').style.left='0px';
		
		document.getElementById('div_down').style.top='0px';
		document.getElementById('div_down').style.bottom='500px';
		
		document.getElementById('content_down').style.width=offsetW+5;
		document.getElementById('content_down').style.height=clientH;
		if(flag == 'up')
			document.getElementById('table_up').width=offsetW;
	}
	
	//add this style to body
	//leftmargin="15" rightmargin="10"
	//overflow:hidden;overflow-x:hidden;overflow-y:hidden;
}

function scroll_div(scroll_y)
{
	document.getElementById('content_down').scrollTop=scroll_y;
}

</script>

<?php
//------------------for single window------------------------
function adjust_head()
{
	echo "<div style=\"position:absolute;z-index=2;top:0px;left:0px;\">";
		echo "<img id=\"img_up\" src=\"../../images/content_up.gif\">";
	echo "</div>";

	echo "<div id=\"div_down\" style=\"position:absolute;z-index=1;top:0px;left:0px;\">";
		echo "<img id=\"img_down\" src=\"../../images/content_down.gif\">";
	echo "</div>";
}

function adjust_title_head()
{
	echo "<div style=\"position:absolute;z-index=100;\">";
}

function adjust_title_tail()
{
	echo "</div>";
}

function adjust_content_head()
{
	global $userInfo,$session_timeout;
	
	echo "<div id=\"content_down\" style=\"height:630;width:1074;position:absolute;z-index=50;top:75px;left:15px;overflow:scroll;overflow-x:hidden;overflow-y:auto;\">";

	$now=time();
	if($now - $userInfo[refresh_time] > $session_timeout)
			$userInfo[privilege]=0;
	else
			$userInfo[refresh_time]=$now;
}

function adjust_content_tail()
{
	echo "</div>";
}

//-----------------for frame window-----------------------
function adjust_head_frame($flag="up")
{
	if($flag == "up")
	{
		echo "<div style=\"position:absolute;z-index=2;top:0px;left:0px;\">";
			echo "<img id=\"img_up\" src=\"../../images/content_up.gif\">";
		echo "</div>";
	
		echo "<div id=\"div_down\" style=\"display:none;position:absolute;z-index=1;top:0px;left:0px;\">";
			echo "<img id=\"img_down\" src=\"../../images/content_down.gif\">";
		echo "</div>";
	}
	else
	{
		
		echo "<div style=\"display:none;position:absolute;z-index=1;top:0px;left:0px;\">";
			echo "<img id=\"img_up\" src=\"../../images/content_up.gif\">";
		echo "</div>";
	//background-color:red;
		echo "<div id=\"div_down\" style=\"position:absolute;z-index=2;top:0px;left:0px;\">";
			echo "<img id=\"img_down\" src=\"../../images/content_down.gif\">";
		echo "</div>";
	}
}

function adjust_head_small_frame($flag="up")
{
	if($flag == "up")
	{
		echo "<div style=\"position:absolute;z-index=2;top:0px;left:0px;\">";
			echo "<img id=\"img_up\" src=\"../../images/content_up.gif\">";
		echo "</div>";
	
		echo "<div id=\"div_down\" style=\"display:none;position:absolute;z-index=1;top:0px;left:0px;\">";
			echo "<img id=\"img_down\" src=\"../../images/content_down_small.gif\">";
		echo "</div>";
	}
	else
	{
		
		echo "<div style=\"display:none;position:absolute;z-index=1;top:0px;left:0px;\">";
			echo "<img id=\"img_up\" src=\"../../images/content_up.gif\">";
		echo "</div>";
	//background-color:red;
		echo "<div id=\"div_down\" style=\"position:absolute;z-index=2;top:0px;left:0px;\">";
			echo "<img id=\"img_down\" src=\"../../images/content_down_small.gif\">";
		echo "</div>";
	}
}

function adjust_head_middle_frame($flag="up")
{
	if($flag == "up")
	{
		echo "<div style=\"position:absolute;z-index=2;top:0px;left:0px;\">";
			echo "<img id=\"img_up\" src=\"../../images/content_up.gif\">";
		echo "</div>";
	
		echo "<div id=\"div_down\" style=\"display:none;position:absolute;z-index=1;top:0px;left:0px;\">";
			echo "<img id=\"img_down\" src=\"../../images/content_down_middle.gif\">";
		echo "</div>";
	}
	else
	{
		
		echo "<div style=\"display:none;position:absolute;z-index=1;top:0px;left:0px;\">";
			echo "<img id=\"img_up\" src=\"../../images/content_up.gif\">";
		echo "</div>";
	//background-color:red;
		echo "<div id=\"div_down\" style=\"position:absolute;z-index=2;top:0px;left:0px;\">";
			echo "<img id=\"img_down\" src=\"../../images/content_down_middle.gif\">";
		echo "</div>";
	}
}

function adjust_head_noleft_frame($flag="up")
{
	if($flag == "up")
	{
		echo "<div style=\"position:absolute;z-index=2;top:0px;left:0px;\">";
			echo "<img id=\"img_up\" src=\"../../images/content_up.gif\">";
		echo "</div>";
	
		echo "<div id=\"div_down\" style=\"display:none;position:absolute;z-index=1;top:0px;left:0px;\">";
			echo "<img id=\"img_down\" src=\"../../images/content_down_noleft.gif\">";
		echo "</div>";
	}
	else
	{
		
		echo "<div style=\"display:none;position:absolute;z-index=1;top:0px;left:0px;\">";
			echo "<img id=\"img_up\" src=\"../../images/content_up.gif\">";
		echo "</div>";
	//background-color:red;
		echo "<div id=\"div_down\" style=\"position:absolute;z-index=2;top:0px;left:0px;\">";
			echo "<img id=\"img_down\" src=\"../../images/content_down_noleft.gif\">";
		echo "</div>";
	}
}

function adjust_title_head_frame($flag="up")
{
	echo "<div style=\"position:absolute;z-index=100;\">";
}

function adjust_title_tail_frame($flag="up")
{
	echo "</div>";
}

function adjust_content_head_frame($flag="up")
{
	global $userInfo,$session_timeout;
	
	if($flag == "up")
		echo "<div id=\"content_down\" style=\"height:630;width:1074;position:absolute;z-index=50;top:75px;left:15px;overflow:hidden;overflow-x:hidden;overflow-y:hidden;\">";
	else
		echo "<div id=\"content_down\" style=\"height:630;width:1074;position:absolute;z-index=50;top:0px;left:15px;overflow:scroll;overflow-x:hidden;overflow-y:auto;\">";
	
	$now=time();
	if($now - $userInfo[refresh_time] > $session_timeout)
			$userInfo[privilege]=0;
	else
			$userInfo[refresh_time]=$now;
}

function adjust_content_tail_frame($flag="up")
{
	echo "</div>";
}

?>
