document.write('<link rel="shortcut icon" href="http://www.donnaclick.it/immagini/favicon.ico" type="image/x-icon"> ');

function MaxLength(Object, MaxLen, Cosa)
{


if (Object.value == ''  ) {
Object.value = Object.value.substring(0 , MaxLen );
Object.scrollTop = Object.scrollHeight;

}


if (Object.value.length > MaxLen  ) {
Object.value = Object.value.substring(0 , MaxLen );
Object.scrollTop = Object.scrollHeight;
alert("Attenzione, hai raggiunto il limite di caratteri a disposizione per " + Cosa);
return false;
}






}


function MaxLength2()
{
Object.value = Object.value.substring(0 , MaxLen );
Object.scrollTop = Object.scrollHeight;



}

function sottolinea (elem) {

elem.style.textDecoration = 'underline';

}

function nosottolinea (elem) {

elem.style.textDecoration = "none";

}



function evidenzia (elem , color , back ){

elem.style.color = color;
elem.style.backgroundColor = back;

}


function mostra (elem){

document.getElementById(elem).style.visibility = "visible" ;

}


function nascondi(elem){

document.getElementById(elem).style.visibility = "hidden" ;

}

function reloadcaptcha(){




window.location.reload();




}




var myRequest = null;

function CreateXmlHttpReq(handler) {
  var xmlhttp = null;
  try {
    xmlhttp = new XMLHttpRequest();
  } catch(e) {
    try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		

		
    } catch(e) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  xmlhttp.onreadystatechange = handler;
  return xmlhttp;
}

function myHandler(idElem) {
    if (myRequest.readyState == 4 && myRequest.status == 200) {
        e = document.getElementById(idElem);
        e.innerHTML = myRequest.responseText;
    }
}




function caricaRegione(){

	IdNaz = document.getElementById("SelNaz").value; 
    myRequest = CreateXmlHttpReq(function() {myHandler("Regione")});
    myRequest.open("GET","./include/getregione.cod.php?IdNazione="+IdNaz);
    document.getElementById("Provincia").innerHTML = "&nbsp;<select class='input_reg' name='Provincia' id='SelPro' style='width: 155px;'><option label='Scegli provincia' value='-1' selected='selected'>Scegli provincia</option></select>"; 
	myRequest.send(null);
	
}


function caricaProvincia(){
	IdReg = document.getElementById("SelReg").value; 
	myRequest = CreateXmlHttpReq(function() {myHandler("Provincia")});
    myRequest.open("GET","./include/getprovincia.cod.php?IdRegione="+IdReg);
    myRequest.send(null);
}

function segnalaLinkRotti(idLink ){
	
	alert('Grazie, segnalazione effettuata con successo !'); 
	myRequest = CreateXmlHttpReq();
    myRequest.open("GET", "http://www.donnaclick.it/include/invioLinks.cod.php?idlink="+idLink);
    myRequest.send(null);
}



function caricaRegione2(){

	IdNaz = document.getElementById("SelNaz").value; 
    myRequest = CreateXmlHttpReq(function() {myHandler("Regione")});
    myRequest.open("GET","../include/getregione.cod.php?IdNazione="+IdNaz);
    document.getElementById("Provincia").innerHTML = "&nbsp;<select class='input_reg' name='Provincia' id='SelPro' style='width: 155px;'><option label='Scegli provincia' value='-1' selected='selected'>Scegli provincia</option></select>"; 
	myRequest.send(null);
	
}


function caricaProvincia2(){
	IdReg = document.getElementById("SelReg").value; 
	myRequest = CreateXmlHttpReq(function() {myHandler("Provincia")});
    myRequest.open("GET","../include/getprovincia.cod.php?IdRegione="+IdReg);
    myRequest.send(null);
}



function popupfoto(UrlFoto , xp , yp , Nome) {
var h , w ;

document.getElementById('imgpop').src = UrlFoto ;
if (xp > yp){
document.getElementById('imgpop').style.width = '500px' ;
w = parseInt(500*yp/xp) 

document.getElementById('imgpop').style.height =  w ;
}

else{
document.getElementById('imgpop').style.height = '400px' ;
h = parseInt(400*xp/yp )
document.getElementById('imgpop').style.width =  h ;

}




document.getElementById('pbianco').style.left =  (document.body.clientWidth - 700)/2;


//if (navigator.appName == "Microsoft Internet Explorer")
//if( navigator.appVersion.indexOf("MSIE 8.")>0)
//if (navigator.appVersion.indexOf("MSIE 6.")<0 || navigator.appVersion.indexOf("MSIE 5.")<0)

	
	
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ 
 var ieversion=new Number(RegExp.$1) 
 if (ieversion>=7){
 
	document.getElementById('pbianco').style.top = document.body.scrollTop + (document.body.clientHeight - 600)/2 ;
	document.body.style.overflow="hidden";
	
document.body.scroll="no";
}
 }


document.getElementById('pnome').innerHTML = Nome;

document.getElementById('imgpop').alt = Nome;
document.getElementById('imgpop').title = Nome;

document.getElementById('pnero').style.display='inline';



document.getElementById('pbianco').style.visibility='visible';




}

function adj(){

document.getElementById('pbianco').style.visibility='hidden';
document.getElementById('pnero').style.display='none';
	document.body.style.overflow="auto";
document.body.scroll="yes";

}

