
var RadunoWin="";

function openRadunoFrame(strMainFrame, strRadunoTitle, strRadunoDir){


  if (RadunoWin!=""){
      RadunoWin.close();
  }

RadunoWin = window.open('../Raduni/RadunoInfo.asp?RadunoDirectory=' + strRadunoDir+'&RadunoTitle='+strRadunoTitle+'&RadunoMainFrame='+strMainFrame,'RadunoInfo','top=100,left=200,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600');

}



var newWin="";
var top;
var left;

function wopenScheda(winLocation,nome,W,H,Scroll){
	top=(600 - H)/2;
	left = (800 - W)/2
	if (newWin==""){
		newWin=window.open(winLocation,nome,'top=' + top + ',left= ' + left + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + Scroll + ',resizable=yes,width=' + W + ',height=' + H);
	} else {
		if (newWin.closed){
		newWin=window.open(winLocation,nome,'top=' + top + ',left= ' + left + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + Scroll + ',resizable=yes,width=' + W + ',height=' + H);
		} else {
			vLocation=top.location 			
			newWin.focus()
			newWin.location=winLocation
			
		}
	}
}

var newWinForm="";
var topForm;
var leftForm;

function wopenForm(winLocation,nome,W,H,Scroll,focus){
	topForm=(600 - H)/2;
	leftForm = (800 - W)/2	
	if (newWinForm==""){
		newWinForm=window.open(winLocation,nome,'top=' + topForm + ',left= ' + leftForm + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + Scroll + ',resizable=yes,width=' + W + ',height=' + H);
	} else {
		if (newWinForm.closed){
		newWinForm=window.open(winLocation,nome,'top=' + topForm + ',left= ' + leftForm + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + Scroll + ',resizable=yes,width=' + W + ',height=' + H);
		} else {
			vLocation=topForm.location 	
			if (focus){
				newWinForm.focus()
			}					
			newWinForm.location=winLocation
		}
	}
}


function SimpleWindow(winLocation,nome){
if (newWinForm==""){
		newWinForm=window.open(winLocation,'SimpleWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no');
	} else {
		if (newWinForm.closed){
		newWinForm=window.open(winLocation,'SimpleWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no');
		} else {
			vLocation=topForm.location 	
			if (focus){
				newWinForm.focus()
			}					
			newWinForm.location=winLocation
		}
	}
}

function SchedaMembro(cognome,nome,id)
{
   wopenScheda("/includes/SchedaMembro.asp?cognome="+cognome+"&nome="+nome+"&id="+id ,"SchedaMembro",675,500,"no");
}

function AddIntrested(form,checked,name)
{
  var firstIndex=0;
  var lastIndex=0;
 // var AppartList = form.AppartmentList.value;
 // var lenOfValue=AppartList.lenght;
  
  
  
  if (checked) {
  
    wopenForm("RequestForm.asp?appName="+name,"SunnyMundo_RequstForm",400,560,"no",false);
     
  }	 else{
       //  not checked - non funziona quest sezzione..... ??
	  // firstIndex = AppartList.indexOf(name,1);
		//if (firstIndex!=0){			
		//		lastIndex = AppartList.indexOf(name,firstIndex);			
		//		form.AppartmentList.value= AppartList.substring(0,firstIndex) + AppartList.substring(lastIndex,lenOfValue)
		//	}
			
  }  
}
