var fullscreenset_web = true;

function redirect_web(vaia){
	location.href = vaia;
}

function annulla_web(){
	
	innder ='';
	document.getElementById("iframe_web").style.width = framew_web+"px";
	document.getElementById("iframe_web").style.height = frameh_web+"px";
	document.getElementById("win_handle_web").style.width = "500px";
	document.getElementById("win_handle_web").style.top = "200px";
	document.getElementById("win_handle_web").style.margin = "0 auto";
	
	framew_now = framew_web;
	frameh_now = frameh_web;
	
	//fullscreenset = false
	//document.getElementById("iframe_web").contentWindow.changewh(framew_web,frameh_web);
	
	fullscreenset_web = true
	
	document.getElementById("win_handle_web").innerHTML = innder;
	document.getElementById("win_root_web").style.visibility = "hidden";	
	window.document.getElementsByTagName('html')[0].style.overflow = ''
}

function popupResizeWeb(){

   var newheight;
    var newwidth;

	if(fullscreenset_web){
		if(document.getElementById){
			newheight=document.getElementById("iframe_web").contentWindow.document.body.scrollHeight;
		};
		document.getElementById("iframe_web").style.height= (newheight)+ "px";
		
		var hpop = document.getElementById("tablesetweb").offsetHeight
		var hwin = document.documentElement.clientHeight
		
		document.getElementById("win_handle_web").style.top = ((hwin-hpop)/2)+"px";
		
		if(hpop>hwin){
			document.getElementById("iframe_web").style.height = hwin-92
			document.getElementById("win_handle_web").style.top = "0px"
			document.getElementById("iframe_web").scrolling = "yes"
		}
		
		document.getElementById("iframe_web").contentWindow.stat = hwin;
	}
	
};


function fullscreen_web(){
	
	if(fullscreenset_web){
	
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//alert("A")
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//alert("B")
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//alert("C")
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		
		wtab = myWidth
		htab = myHeight
		
		//alert(wtab)
		//alert(htab)
		
		document.getElementById("iframe_web").style.width = wtab-30+"px";
		document.getElementById("iframe_web").style.height = htab-80+"px";
		document.getElementById("win_handle_web").style.width = "100%"
		document.getElementById("win_handle_web").style.height = "100%"
		document.getElementById("win_handle_web").style.top = "7px"
		
		document.getElementById("win_handle_web").style.margin = "0 auto";
		//document.getElementById("win_root_web").style.left = "0px";
		
		framew_now = wtab;
		frameh_now = htab;
		fullscreenset_web = true
		
		//document.getElementById("iframe_web").contentWindow.changewh(wtab,htab);
		fullscreenset_web = false
		
	}else{
		document.getElementById("iframe_web").style.width = framew_web+"px";
		document.getElementById("iframe_web").style.height = frameh_web+"px";
		
		document.getElementById("win_handle_web").style.width = "500px";
		document.getElementById("win_handle_web").style.top = "200px";		
		document.getElementById("win_handle_web").style.margin = "0 auto";
		
		framew_now = framew_web;
		frameh_now = frameh_web;
		
		fullscreenset_web = false
		
		//document.getElementById("iframe_web").contentWindow.changewh(framew_web,frameh_web);
		
		fullscreenset_web = true
		
	}
	
	
}

var i = 0;
var inetrdownerMenu = ""

function SVopenWin_web(urlframe,w,h,full,closed,setscroll,focusSet){
	
		if(setscroll){
			setscroll = "no"
		}else{
			setscroll = "yes"
		}
	
		window.document.getElementsByTagName('html')[0].style.overflow = 'hidden'
	
		document.getElementById("win_handle_web").style.width = w;
		document.getElementById("win_handle_web").style.height = h;
		
		
		framew_web = w; 
		frameh_web = h;
		
		innder ='<table border="0" cellpadding="0" cellspacing="0" id="tablesetweb" >'
		innder +='	<tr>'
		innder +='		<td width="15" height="8px" ><img src="img/struttura/popup/pop_04.png" width="15px" height="8px" /></td>'
		innder +='		<td height="8px" style="background:url(include_Img/popup/pop_xx.png) #ffffff"><table style="background:url(img/struttura/popup/pop_05.png) #ffffff no-repeat"  height="8px" width="100%" ><tr><td></td></tr></table></td>'
		innder +='		<td width="15" height="8px" ><img src="img/struttura/popup/pop_06.png" width="15px" height="8px" /></td>'
		innder +='	</tr><tr>'
		innder +='		<td ><img src="img/struttura/popup/pop_07.png" width="15" height="37" /></td>'
		innder +='		<td height="37" style="background:url(include_Img/popup/pop_xx.png) #ffffff" >'
		innder +='			<table width="100%" height="100%" border="0" style="background:url(img/struttura/popup/pop_08.png) no-repeat #ffffff" cellpadding="0" cellspacing="0">'
		if(focusSet){
			innder +='				<tr><td width="100%" style="text-align:left; font-size:18px; font-family:helvetica, sans-serif; color:#203d6d; vertical-align: middle;">&nbsp;&nbsp;<img src="img/idvlogomin.png" /><span id="iframeTitle_web"></span></td>'
		}else{
			innder +='				<tr><td width="100%" style="text-align:left; font-size:18px; font-family:helvetica, sans-serif; color:#203d6d; vertical-align: middle;"><span id="iframeTitle_web"></span></td>'	
		}
		if (full){
			innder +='			<td width="25px"><a href="javascript:fullscreen_web();"><img src="img/struttura/popup/full.png"/></a></td>'
		}else{
			innder +='			<td width="25px"></td>'
		}
		
		if(closed){
			innder +='			<td width="25px"><a href="javascript:annulla_web();"><img src="img/struttura/popup/close.png"/></a></td>'
		}else{
			innder +='			<td width="25px"></td>'
		}
		innder +='			</table>'
		innder +='		</td><td><img src="img/struttura/popup/pop_09.png" width="15" height="37" /></td>'
		innder +='	</tr><tr>'
		innder +='		<td background="img/struttura/popup/pop_13.png"></td>'
		innder +='		<td bgcolor="#FFFFFF">'
		
		innder += '			<iframe name="iframe_web" src="'+urlframe+'" scrolling="'+setscroll+'" id="iframe_web" style="width:'+w+'px; height:'+h+'px;margin:0;" frameborder="0" ></iframe>';
		
		innder += '		</td>'
		innder += '		<td background="img/struttura/popup/pop_15.png">&nbsp;</td>'
		innder += '	</tr><tr>'
		innder += '		<td width="15" height="15"><img src="img/struttura/popup/pop_16.png" width="15" height="16" /></td>'
		innder += '		<td background="img/struttura/popup/pop_17.png"></td>'
		innder += '		<td width="15" height="15"><img src="img/struttura/popup/pop_18.png" width="15" height="16" /></td>'
		innder += '</tr></table>'
		
		document.getElementById("win_handle_web").innerHTML = innder;
		//document.getElementById("win_root_web").style.visibility = "hidden";
		var Dimheight;
		if (window.innerHeight){
			Dimheight = window.innerHeight;
		}else if (document.documentElement && document.documentElement.clientHeight != 0){
			Dimheight = document.documentElement.clientHeight;
		}else if (document.body){
			Dimheight = document.body.clientHeight;
		} 
		
		var Dimhight_pop = document.getElementById("win_handle_web").offsetHeight;
		
		document.getElementById("win_handle_web").style.top = ((Dimheight-Dimhight_pop)/2)+"px";
		document.getElementById("win_handle_web").style.margin= "0 auto";
		//document.getElementById("win_root_web").style.visibility = "visible";
		document.getElementById("win_root_web").style.visibility = "visible";
		
	
	fullscreenset_web = true
	
}
		
	/*
	function downerMenu(h,a){
		i = (i+(i/12));
		document.getElementById("win_root_web").style.top = (a+i)+"px";		
		if((a+i) >= ((h/2)-70)){
			clearInterval(inetrdownerMenu)	
		}
	}
	*/
