// SAFE FOOD PACKAGING PORTAL
// INRA\Olivier Vitrac
// revision 12/10/07

var win=null;
var texte='>> SAFE FOOD PACKAGING PORTAL: decision tools for the food-packaging community: design / risk assessment / simulation / optimization >> Feel free to apply for an account >> Take a look at our help section and disclaimer >> Each color is related to a section >> For any question, suggestion or contribution, contact: olivier.vitrac@agroparistech.fr >>';
var lgtexte=texte.length-1;
var postexte=0;
var tg = 0;
var current = "none";
var sc_project=3044218; 
var sc_invisible=0; 
var sc_partition=33; 
var sc_security="5b567b19"; 
var sc_text=1; 


today = new Date();
dateGMT = today.toGMTString();
if (navigator.appName=="Microsoft Internet Explorer") {
	ip = 'unknown';
	host="<em>(with js+IE)</em>";
	}
else {
	adip=java.net.InetAddress.getLocalHost();
	ip=adip.getHostAddress();
	host=adip.getHostName();
	}

function redirecttotmp() {
var sHTML = '<html><head><title>Current simulations</title></head>\n<body>\n\t<div%20align="center">\n';
sHTML += "<font size=\"+4\" face=\"Georgia, Times New Roman, Times, serif\" color=\"#00CCFF\"> Files from previous runs<br></font>";
sHTML += "<font color=\"#00CCCC\"> These examples illustrate the functionalities of the available implemented tools.<br></font>";
sHTML += "\t</div>\n</body></html>";
document.body.innerHTML=sHTML;
alert("I am aware that no legends are provided.\n For further information, please contact us:\nolivier.vitrac@agroparistech.fr")
window.location.href="tmp/";
}

function msgdefil()
{if (postexte == texte.length)
postexte=0;
if (postexte<=lgtexte)
{afftexte = texte.substring((texte.length-(lgtexte-postexte)),texte.length) + texte.substring(0,postexte);
postexte++;}
window.status = afftexte;
vitessedefil = setTimeout("msgdefil()", 100);
}

function NewWindow(mypage,myname,w,h,scroll,pos) {
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}


function hide(id){
	if (id!="all"){
		if (current==id) {
			clearTimeout(tg);
			tg = setTimeout("document.all."+id+".style.display='none'",30000);
		}
		else {
			if (current!="none"){tg = setTimeout("document.all."+current+".style.display='none'",200)};
			current=id;
			tg = setTimeout("document.all."+id+".style.display='none'",3000);
		}
	}
	else {
		document.all.menu1.style.display="none";
		document.all.menu2.style.display="none";
		document.all.menu3.style.display="none";
		document.all.menu4.style.display="none";
		document.all.menu5.style.display="none";
		document.all.menu6.style.display="none";
		document.all.menu7.style.display="none";
		document.all.menu8.style.display="none";
		document.all.menu9.style.display="none";
		document.all.menu10.style.display="none";
		document.all.menu11.style.display="none";
		document.all.bottom1.style.display="none";
		document.all.bottom2.style.display="block";
		hide('bottom2');
		document.all.bottom3.style.display="none";
	}
}

function hidend(id){
	eval("document.all."+id+".style.display='none'");
}

function vis(id){
	eval("document.all."+id+".style.display='block'");
}
