// JavaScript Document

function winComandoDigitale()
{
	newWin = window.open( '/Flash/XX/Controllo_digitale.htm' , 'newWin' , 'width=800,height=420,scrollbars=no' );	
	newWin.moveTo(0,0);
	newWin.focus();
}

function winRaffrescatori( lang )
{
	newWin = window.open( '/XX/'+lang+'/calcola_raffrescatori.php' , 'newWin' , 'width=700,height=900,scrollbars=no' );
	newWin.moveTo(0,0);
	newWin.focus();
}

function winInstallazioni( lang )
{
	size = getSize();
	newWin = window.open( '/Flash/XX/Installazioni.html' , 'newWin' , 'width=700,height='+size.height+',scrollbars=yes' );	
	newWin.moveTo(0,0);
	newWin.focus();
}

function checkIt( strToFind )
{
	strAgent = navigator.userAgent.toLowerCase();
	intPlace = strAgent.indexOf(strToFind) + 1;
	return intPlace;
}

function writeEmail(testo,account,dominio,thesubject,thebody)
{
	document.write( '<a href="mailto:'+account+'@'+dominio+'?subject='+escape(thesubject)+'&body='+escape(thebody)+'" >'+testo+'</a>' );	
}

function doOnLoad()
{
	//objUrl = new clsURL();
	//objUrl.setLangParamName("l");
}

function getSize()
{
  var winWidth = 0, winHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    winWidth = window.innerWidth;
    winHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    winWidth = document.documentElement.clientWidth;
    winHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    winWidth = document.body.clientWidth;
    winHeight = document.body.clientHeight;
  }
  
  return { width: winWidth , height: winHeight };
}

window.onload = doOnLoad;

