 /*
	 File:	 open.js
	 Author: Andrea Cappalunga
	 (C) 2006 Informacibo
*/ 

var quest_num = 0;

function OpenFullScreen( page , name )
{
   var wOpen;
   var sOptions;

   sOptions = 'status=no,menubar=no,resizable=no,toolbar=no';
   sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString();
   sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString();
   sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';

   wOpen = window.open( '', name, sOptions );
   wOpen.location = page;
   
   wOpen.moveTo( 0, 0 );
   
   wOpen.resizeTo( screen.availWidth, screen.availHeight );
   if (document.all) {
		wOpen.resizeTo(screen.availwidth,screen.availheight);
	}
	else if (document.layers||document.getElementById) {
		if(wOpen.outerheight<screen.availheight || wOpen.outerwidth<screen.availwidth){
			wOpen.outerheight = screen.availheight;
			wOpen.outerwidth = screen.availwidth;
			}
	}
	
   wOpen.focus();
   
   return wOpen;
}

function OpenCredits()
{
   var wOpen;
   var sOptions;

   sOptions = 'status=no,menubar=no,resizable=no,toolbar=no';
   sOptions +=',width=360,height=450';

   wOpen = window.open( '', 'credits', sOptions );
   wOpen.location = "credits.php";

   wOpen.focus();

}

function OpenLettera()
{
   var wOpen;
   var sOptions;

   sOptions = 'status=no,menubar=no,resizable=no,toolbar=no,scrollbars=yes';
   sOptions +=',width=600,height=660';

   wOpen = window.open( '', 'credits', sOptions );

   wOpen.location = "lettera.php";

   wOpen.focus();

}

function OpenPresentazione()
{
   var wOpen;
   var sOptions;

 	sOptions = 'status=no,menubar=no,resizable=no,toolbar=no,scrollbars=yes';
   sOptions +=',width=600,height=660';

   wOpen = window.open( '', 'credits', sOptions );
   wOpen.location = "presentazione.php";

   wOpen.focus();

}



function OpenPrefazione()
{
   var wOpen;
   var sOptions;

	 sOptions = 'status=no,menubar=no,resizable=no,toolbar=no,scrollbars=yes';
   sOptions +=',width=700,height=660';

   wOpen = window.open( '', 'credits', sOptions );
   wOpen.location = "prefazione.php";

   wOpen.focus();

}


var tabs = Array();
 tabs[0] = "chef_generalities";
 tabs[1] = "chef_questions";
var textl = Array();
textl[0] = "I Consigli dello Chef ->";
textl[1] = " <- Lo Chef";
var activetab = 0;
var min_perc = 5;

var chefbar_size = Array();
chefbar_size[0] = 200;
chefbar_size[1] = 400;

function SwapChefBar(obj)
{

	tabsnum = tabs.length;

	for(i=0; i< tabsnum ; i++)
	{
		document.getElementById(tabs[i]).style.display='none';
	}	
	
	activetab = (activetab+1)%tabsnum;
	
	obj.innerText = textl[activetab];
	document.getElementById(tabs[activetab]).style.display='block';
//	document.getElementById('chefbar').style.width=chefbar_size[activetab]+'px';
}


function ShowItalian(){
	document.getElementById('restaurant_desc_en').style.display='none';
	document.getElementById('restaurant_desc').style.display='block';
	
	for(i=0; i<quest_num; i++){
		document.getElementById("q"+i+"_it").style.display='block';
		document.getElementById("q"+i+"_en").style.display='none';
	}
	
}

function ShowEnglish(){
	document.getElementById('restaurant_desc_en').style.display='block';
	document.getElementById('restaurant_desc').style.display='none';
	
	for(i=0; i<quest_num; i++){
		document.getElementById("q"+i+"_it").style.display='none';
		document.getElementById("q"+i+"_en").style.display='block';
	}
}












