// JavaScript Document
<!-- Begin
//document.write('Your settings are ' + screen.width + ' x ' + screen.height + '');
//alert('Your settings are ' + screen.width + ' x ' + screen.height + '');

/* FULLSCREEN */
/*
*/
var larghezza = screen.width;
var altezza = screen.height-30;

/* RIS 1280 x 800 */
/*
var larghezza = 1280;
var altezza = 800;
*/

/* RIS 1280 x 1024 */
/*
var larghezza = 1280;
var altezza = 924;
*/

/* RIS 1024 x 768 */
/*
var larghezza = 1024;
var altezza = 768;
*/


/*
function imageSection(){
	window.alert('width: ' + document.getElementById('immSection').width + ' - height: ' + document.getElementById('immSection').height);
}
*/

function getInternetExplorerVersion() {

    var rv = -1; // Return value assumes failure.

    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    return rv;
}

function checkVersion() {
    var msg = "You're not using Windows Internet Explorer.";
    var ver = getInternetExplorerVersion();
    if (ver > -1) {
        if (ver >= 8.0)
            document.getElementById('flashcontent').style.width = larghezza;
			//msg = "You're using a recent copy of Windows Internet Explorer."
        //else
           // msg = "You should upgrade your copy of Windows Internet Explorer.";
    }
    //alert(msg);
}

function loadImages() {
if (document.getElementById) {  // DOM3 = IE5, NS6
document.getElementById('hidepage').style.visibility = 'hidden';
document.getElementById('hidepage').style.display = 'none';
document.getElementById('section').style.visibility = 'visible';
}
else {
if (document.layers) {  // Netscape 4
document.hidepage.visibility = 'hidden';
document.hidepage.display = 'none';
document.section.visibility = 'visible';
}
else {  // IE 4
document.all.hidepage.style.visibility = 'hidden';
document.all.hidepage.style.display = 'none';
document.all.section.style.visibility = 'visible';
      }
   }
}

function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );

  //window.resizeTo(larghezza,altezza)
  //moveTo(0,0)
  
  //document.getElementById("contenuti").style.height = clientHeight;
  if(myWidth<1000){
	   document.getElementById("logo_rv").style.position = "absolute";
	   document.getElementById("pannello_utente").style.display = "none";
	   document.getElementById("menunew").style.left = 150 + "px";
	   document.getElementById("menunew").style.marginLeft = 0 + "px";
	   document.getElementById("menunew").style.position = "absolute";
	   document.getElementById("menunew_bg").style.left = 150 + "px";
	   document.getElementById("menunew_bg").style.marginLeft = 0 + "px";
	   document.getElementById("menunew_bg").style.position = "absolute";
	   document.getElementById("section").style.left = 125 + "px";
	   document.getElementById("section").style.marginLeft = 0 + "px";
	   document.documentElement.style.width = 950 + "px";
	   document.documentElement.style.overflowX = "scroll";
	   //document.body.style.width = 1050 + "px";
		window.resizeTo(1000,altezza)
		moveTo(0,0)
  }else{
	   document.getElementById("logo_rv").style.position = "fixed";
	   document.getElementById("pannello_utente").style.display = "inherit";
	   document.getElementById("menunew").style.left = 50 + "%";
	   document.getElementById("menunew").style.marginLeft = -375 + "px";
	   document.getElementById("menunew").style.position = "fixed";
	   document.getElementById("menunew_bg").style.left = 50 + "%";
	   document.getElementById("menunew_bg").style.marginLeft = -375 + "px";
	   document.getElementById("menunew_bg").style.position = "fixed";
	   document.getElementById("section").style.left = 50 + "%";
	   document.getElementById("section").style.marginLeft = -400 + "px";
	   document.documentElement.style.width = 100 + "%";
	   //document.body.style.width = 100 + "%";
	   document.documentElement.style.overflowX = "hidden";
  }
  if(myWidth<1150 || myHeight<800){
	   document.getElementById("logo_rv").style.width = 100 + "px";
	   document.getElementById("logo_rv").style.height = 100 + "px";
	   document.getElementById("logo_rv").style.left = 5 + "px";
	   document.getElementById("logo_rv").getElementsByTagName("img").item(0).style.width = 100 + "px";
	   document.getElementById("logo_rv").getElementsByTagName("img").item(0).style.height = 100 + "px";
  }else{
	   document.getElementById("logo_rv").style.width = 150 + "px";
	   document.getElementById("logo_rv").style.height = 150 + "px";
	   document.getElementById("logo_rv").style.left = 25 + "px";
	   document.getElementById("logo_rv").style.top = 15 + "px";
	   document.getElementById("logo_rv").getElementsByTagName("img").item(0).style.width = 150 + "px";
	   document.getElementById("logo_rv").getElementsByTagName("img").item(0).style.height = 150 + "px";
  }
}

/*
function getCookie(c_name){
if (document.cookie.length>0){
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1){
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function setCookie(c_name,value,expiredays){
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

////////////////////////////////////////////////////////
function checkCookie(){
wHeight=getCookie('wHeight');
if (wHeight!=null && wHeight!="")  {
  alert('altezza Schermo: '+wHeight+'!');
}
else  {
  wHeight=altezza-150;
  if (wHeight!=null && wHeight!=""){
    setCookie('wHeight',wHeight,365);
    }
  }
}

function checkCookie(){
wHeight=getCookie('wHeight');
if (username!=null && username!="")  {
  alert('Welcome again '+username+'!');
  }
else  {
  username=prompt('Please enter your name:',"");
  if (username!=null && username!=""){
    setCookie('username',username,365);
    }
  }
}
////////////////////////////////////////////////////////
*/

document.write('<style type="text/css">');
/*
if(larghezza > 1280){
	document.write('#eventi{ width: 225px; }');
}else{
	document.write('#eventi{ width: 200px; }');
}
*/
if(larghezza > 1024){
	document.write('#flashcontent{position: fixed;}');
	document.write('#section #image, #section #novita{width: 300px; left:-10px;}');
	document.write('#section #image img{width: 300px;}');
	/*
	document.write('#logo_rv{ width: 150px; height: 150px; left: 25px; top: 10px; }');
	document.write('#eventi{ top: 175px; font-size: 12px; line-height: 13px; }');
	document.write('#pannello_utente{ top: 185px; }');
	*/
}else{
	document.write('#flashcontent{position: fixed;}');
	document.write('#eventi{ visibility: hidden; display:none; }');
	document.write('#section #image, #section #novita{width: 200px; left:-5px;}');
	document.write('#section #image img{width: 200px;}');
	/*
	document.write('#logo_rv{ width: 100px; height: 100px; left: 5px; }');
	document.write('#logo_rv img{ width: 100px; height: 100px; left: 5px; top: 5px; }');
	document.write('#eventi{ top: 110px; font-size: 12px; line-height: 12px; }');
	document.write('#pannello_utente{ top: 135px; }');
	*/
}
if(altezza > 850){
	//document.cookie = "ScreenHeight=" + screen.height
	document.write('#logo_rv{ width: 150px; height: 150px; left: 25px; top: 10px; }');
	document.write('#eventi{ font-size: 12px; line-height: 13px; }');
	/* document.write('#pannello_utente{ top: 185px; }'); */
}else{
	document.write('#logo_rv{ width: 100px; height: 100px; left: 5px; }');
	document.write('#logo_rv img{ width: 100px; height: 100px; left: 5px; top: 5px; }');
	document.write('#eventi{ font-size: 11px; line-height: 11px; }');
	/* document.write('#pannello_utente{ top: 125px; }'); */
}
	//document.write('#gallery{visibility: hidden;}');
	document.write('#gallery{filter: Alpha(Opacity=0); -moz-opacity:0;}');
	document.write('</style>');
	
	
function resize(){
//document.getElementById('gallery').style.visibility="hidden";
//opacity('gallery', 100, 0, 0)	
window.resizeTo(larghezza,altezza)
//window.resizeTo(1024,768)
//window.resizeTo(1280,960)
moveTo(0,0)

	//// DISABILITA IL REFRESH DELLA PAGINA SU INTERNET EXPLORER //////////////
	/*
	window.onbeforeunload = function() {
		var url = window.location.href;
		var nohttp = url.split('//')[1];
		var hostPort = nohttp.split('/')[0]
		//alert (hostPort)
		//alert (url)
		//document.location.href = url
		document.location.href = "http://www.roncato.it"
		//return false;
	};
	
	if (document.all){ 
	document.onkeydown = function (){ 
	var key_f5 = 116; // 116 = F5 
	
	if (key_f5==event.keyCode){ 
	event.keyCode = 27;
	alert("stai premendo il tasto F5");
	
	if (key_f5==event.keyCode||(event.ctrlKey && (event.keyCode == 78 || event.keyCode == 82))){ return false; }
	alert("stai premendo il CTRL+N o il tasto CTRL+R");
	
	return false; 
	} 
	} 
	} 
	*/
	
	///////////////////////////////////////////////////////////////////////////
	vpos = document.getElementById("pannello_utente").offsetTop;
	opos = document.getElementById("pannello_utente").offsetLeft;
	//alert(vpos + " - " + opos);
	if(opos<400){
		var url = window.location.href;
		var nohttp = url.split('//')[1];
		var hostPort = nohttp.split('/')[0]
		//alert (hostPort)
		//alert (url)
		document.location.href = url
	}
	
}

// End -->