//////////////////////////////////////////////////////////////////////// 
function oPage( p, w, h, title ){
	if(!w) w = 440;
	if(!h) h = 260;
	if(!title) title = '';
	var features = 'toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width='+w+',height='+h+',dependent=1';
	window.popUpWin = window.open(p, title, features);
	window.popUpWin.focus();
}
//////////////////////////////////////////////////////////////////////// 

//////////////////////////////////////////////////////////////////////// 
function writeFlash( xName, xPath, W, H, xVars, xTrasp ){
	
	xVars += "&appExt=aspx";
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');
	document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" '); 
	document.write('width="' + W + '" height="' + H + '" id="' + xName + '" align="middle"> ');
	document.write('<param name="FlashVars" value="' + xVars + '">');
	document.write('<param name="allowScriptAccess" value="sameDomain"> ');
	document.write('<param name="movie" value="' + xPath + '"> ');
	if( xTrasp==true ) document.write('<param name="wmode" value="transparent"> ');
	document.write('<embed FlashVars="' + xVars + '"  ');
	document.write('src="' + xPath + '" width="' + W + '" height="' + H + '" name="' + xName + '" align="middle" ');
	if( xTrasp==true ) document.write('wmode="transparent" ');
	document.write('swLiveConnect="true" ');
	document.write('allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" /> ');
	document.write('</object>');
	
}
//////////////////////////////////////////////////////////////////////// 
function submitCommonForm( xForm, xURL ){
	var myForm = document.getElementById( xForm );
	if( xURL ){
		myForm.action = myForm.action + xURL;
	}
	myForm.submit();
}
//////////////////////////////////////////////////////////////////////// 


//////////////////////////////////////////////////////////////////////////////////////////////////////////// Div Style
function getDivStyle( xTg ){
	if( document.layers ){ 
		return eval('document.'+xTg); 
	}else if( document.all ){ 
		return eval('document.all.'+xTg+'.style'); 
	}
	var xDiv = document.getElementById(xTg);
	if( xDiv ) return xDiv.style;
	return;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////



//////////////////////////////////////////////////////////////////////////////////////////////////////////// 
function Fvalidate( ID, xForm ){
	///////////////////////////////
	var myForm = document.getElementById( xForm+ID );
	var opt = myForm["searchMode"];
	var msgForm = this['FmsgRequest'+ID];
	var msgAlert = '';
	///////////////////////////////
	if( opt[0].checked ){
		var cmpToCheck = myForm['Xcity'];
		if( cmpToCheck.value=='' )  msgAlert = msgForm;
	} else {
		var cmpToCheck = myForm['XcapSolo'+ID];
		if( cmpToCheck.value=='' )  msgAlert = msgForm;
	}
	///////////////////////////////
	if( msgAlert=='' ){
		myForm.submit();
	} else {
		alert( msgForm );
	}
	///////////////////////////////
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////// 
function FsearchOption( ID, xSel, xForm ){
	///////////////////////////////
	for( var i=0; i<2; i++ ){
		var sM = getDivStyle( "FsearchMode"+ID+"_"+i );
		sM.display = "none";
	}
	sM = getDivStyle( "FsearchMode"+ID+"_"+xSel );
	sM.display = "";
	///////////////////////////////
	var myForm = document.getElementById( xForm+ID );
	myForm["searchMode"][xSel].checked = true;
	///////////////////////////////
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////// 
function FcheckCAP( ID ){
	///////////////////////////////
	var addr = document.getElementById( "Xaddress" + ID );
	var cap = document.getElementById( "Xcap" + ID );
	var lblCap = document.getElementById( "labelXcap" + ID );
	if( addr && cap ){
		if( addr.value!="" ){
			cap.disabled = false;
			lblCap.className = "nero10";
		} else {
			cap.disabled = true;
			cap.value = "";
			lblCap.className = "grey10";
		}
	}
	///////////////////////////////
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////// 




//////////////////////////////////////////////////////////////////////// 
//POP_UP
//////////////////////////////////////////////////////////////////////// 
function openWin(url,features){
	/*
	--	[ DESC ] --
		Apre una finestra in Pop_up
	---------------
	*/
	if(!features){
		
		features = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=640'
	}
	
	features += ", dependent=1"
	
	var winName = "popUpWin"
	
	if(window.popUpWin){
		deleteWin(window.popUpWin)
	}
	//----
	window.popUpWin = window.open(url,winName,features);
	window.popUpWin.focus()
}
//////////////////////////////////////////////////////////////////////// 

//////////////////////////////////////////////////////////////////////// 
//Chiude POPUP
//////////////////////////////////////////////////////////////////////// 

function deleteWin(winName){
	if(winName.closed!=true){
		winName.close()
	}
}
//////////////////////////////////////////////////////////////////////// 