<?php

session_start();
@$permission = $_POST['permission'];
@$userid = $_POST['userid'];
?>


<!doctype html public "-//w3c//dtd html 3.2//ja">
<html>
<head>
<title>pgctn main menu</title>
<meta http-equiv=content-type content="text/html; charset=x-euc-jp">


<SCRIPT LANGUAGE="JavaScript">
<!-- Begin

function code(){
	return navigator.appCodeName
  }
function ielang(){
	return navigator.browserLanguage
  }
function nnlang(){
	return navigator.language
  }
function agent(){
	return navigator.userAgent
  }
function scwidth(){
	return screen.width
  }
function scheight(){
	return screen.height
  }
  
function browser(){
	var browser = '';
	var agent = navigator.userAgent;

	
	j = agent.indexOf("Windows");
	if(j != -1) browser += 'win';
	else browser += '';
	
	j = agent.indexOf("Mac");
	if(j != -1) browser += 'mac';
	else browser += '';
	return browser
  }


function main(){
	return "main_menu.php?browser=" + browser() + "&scwidth=" + scwidth() + "&scheight=" + scheight()   ;
  }



//END -->
</script>


</head>
<body BACKGROUND="./img/yellow.jpg" onLoad = "setTimeout('location.replace(main());', 1000)">


<center>

<h3>Welcome to pgctn DICOM server<br>
Now setting Configuration of Web browser.</h3>
<h2>Please wait a second...</h2>


<table border=2>


<tr><td>

Client environment<br>

<script language="JavaScript">
<!--
document.write("code name:"
+ navigator.appCodeName + "<br>");
document.write("(IE):"
+ navigator.browserLanguage + "<br>");
document.write("(NN):"
+ navigator.language + "<br>");
document.write("User agent name:<br>"
+ navigator.userAgent + "<br>");



document.write("can I  use cookie?:"
+ navigator.cookieEnabled + "<br>");
document.write("can I use Java?:"
+ navigator.javaEnabled() + "<br>");
document.write("can I use data taint?:"
+ navigator.taintEnabled());



document.write('<pre>');
document.writeln('resolution of horizontal'
+ screen.width);
document.writeln('resolution of vertical'
+ screen.height);
document.write('color depth '
+ Math.pow(2, screen.colorDepth));
document.write('</pre>');




var b_n = navigator.appName.charAt(0);
var b_v = eval(navigator.appVersion.charAt(0));
if(b_n == 'M' && b_v >= 4)	{
b_w = document.body.clientWidth;
b_h = document.body.clientHeight;
}
else if(b_n == 'N' && b_v >= 4)	{
b_w = innerWidth;
b_h = innerHeight;
}
else	{
b_w = 'can not detecte';
b_h = 'can not detect';
}
document.write('<pre>');
document.writeln('current window width:' + b_w);
document.write('current window hight:' + b_h);
document.write('</pre>');



document.write("browserĄ§"
+ browser() + "<br>");


//ip = document.myFORM.IP.value;
//document.write('your IP' + ip);

//-->
</script>

</td></tr>
</table>

<?php
//session confirm
if (!session_id()){
print("<font color=red>Session is not started.Please login and start session.</font><br>");
}
else{
print("<font color=blue>Session is already started.</font><br>");
}
?>

<?
    $addr = getenv("REMOTE_ADDR");
	if($addr == "127.0.0.1"){
	print("<font color=blue>OK,your connection is established by ssh and portfording.</font>");
	}
	else{
	print("<font color=red>OOPS,you connect this server without ssh wrapper.</font>");
	}
?>

</body>
</html>
