// QUESTA FUNZIONE SERVE PER NON FARE RICARICARE LE IMMAGINI IN CACHE A IE6
try {
  document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}
//

var win=null;

function OpenNewWindow(mypage,myname,w,h,scroll,pos)
{
    if(pos=="random")
    {
        LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
        TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
    }
    if(pos=="center")
    {
        LeftPosition=(screen.width)?(screen.width-w)/2:100;
        TopPosition=(screen.height)?(screen.height-h)/2:100;
    }
    else if((pos!="center" && pos!="random") || pos==null)
    {
        LeftPosition=0;
        TopPosition=20
    }

    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';

    win=window.open(mypage,myname,settings);

    if(win.focus)
    {
        win.focus();
    }
}

function showLoadingDiv(id, show){
    div = document.getElementById(id);
    if (show){
        div.style.display = "block";    
    }else{
        div.style.display = "none";     
    }
}

function formSubmit(formObj){
    window.location='#';
    showLoadingDiv('loading',true);
    //document.forms.modulo_articolo.submit();
    formObj.submit();
}

function formSubmitContatti(formObj){
   /* alert(formObj.elements.privacy.checked);
	return false;*/
	
	if(!formObj.elements.privacy.checked){
		alert('E\' necessario leggere l\'informativa')
		window.location = '#informativa'
		return false;
	}
	if(!formObj.elements.consenso_Y.checked){
		alert('E\' necessario dare il proprio consenso\nal trattamento dei dati personali')
		window.location = '#consenso'
		return false;
	}	
	
	window.location='#';	
    showLoadingDiv('loading',true);
    formObj.submit();
}

function formSubmitModifica(formObj){
   	window.location='#';	
    showLoadingDiv('loading',true);
    formObj.submit();
}

function formSubmitAnnuncio(formObj){
   /* alert(formObj.elements.privacy.checked);
	return false;*/
	
	if(!formObj.elements.condizioni.checked){
		alert('E\' necessario leggere le Condizioni del Servizio')
		window.location = '#informativa'
		return false;
	}
	if(!formObj.elements.consenso_Y.checked){
		alert('E\' necessario accettare le condizioni del servizio')
		window.location = '#consenso'
		return false;
	}	
	
	window.location='#';	
    showLoadingDiv('loading',true);
    formObj.submit();
}





//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com



var message="Spiacenti, questa funzione e' disabilitata.\n\nI contentuti e le immagini hanno il Copyright di Salute Store,\n e non possono essere riutilizzati.";

///////////////////////////////////
function clickIE4(){
	if (event.button==2){
		alert(message);
		return false;
	}
}
function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			alert(message);
			return false;
		}
	}
}
if (document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
	document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
