// JavaScript Document
// cambio immagini delmenu
function rollOver(id, img){
	if(document.getElementById){
		document.getElementById(id).src = img;
		}
	}
	
function rollOut(id, img){
	if(document.getElementById){
		document.getElementById(id).src = img;
		}
	}
	
	
//mostra e nascondi div
function mostra(divID){
	if(document.getElementById){
		document.getElementById(divID).style.visibility = 'visible';
	}
}
function nascondi(divID){
	if(document.getElementById){
		document.getElementById(divID).style.visibility = 'hidden';
	}
}

  
//funzione per l'apertura di una finestra interna

function openInternalWindow(URL, W, H){
var aw = screen.availWidth;
var ah = screen.availHeight;
var posX = (aw-W)/2;
var posY = (ah-H)/2;
var absPath = 'http://www.zeronovecomunicazione.it/web/scuolapercoach/img/';
var imageName = absPath+URL;
	if(document.getElementById){
// IE6 +4.01 but no scrolling going on
if (document.documentElement && document.documentElement.scrollTop){
	var Yscroll = document.documentElement.scrollTop;
	}
// IE6 +4.01 and user has scrolled
else if (document.body && document.body.scrollTop){
		var Yscroll = document.body.scrollTop;
}
if (Yscroll == undefined){
	Yscroll = 0;
	}
		var alt = document.body.offsetHeight;
		document.getElementById('winDiv').style.display = 'block';
		document.getElementById('bgBlack').style.display = 'block';
		document.getElementById('bgBlack').style.height = (alt+50)+'px';
		document.getElementById('winIMG').src = imageName;
		document.getElementById('winDiv').style.width = W+'px';
		document.getElementById('winDiv').style.height = H+'px';
		document.getElementById('winDiv').style.left = posX+'px';
		document.getElementById('winDiv').style.top = (posY+Yscroll)+'px';
		}
	}
	
	
//funzione per la chiusura della finestra interna

function closeInternalWindow(){
	if(document.getElementById){
	document.getElementById('winDiv').style.display = 'none';
	document.getElementById('bgBlack').style.display = 'none';
		document.getElementById('winIMG').src = '';
		document.getElementById('winDiv').style.width = 0+'px';
		document.getElementById('winDiv').style.height = 0+'px';
		document.getElementById('winDiv').style.left = 0+'px';
		document.getElementById('winDiv').style.top = 0+'px';
		}
	}
	
//funzione per l'aperura della finestra scheda info coach interna	
	
	function apriScheda(paginaScheda){
		var aw = screen.availWidth;
var ah = screen.availHeight;
var posX = (aw-400)/2;
var posY = (ah-250)/2;
if(document.getElementById){
if (document.documentElement && document.documentElement.scrollTop){
	var Yscroll = document.documentElement.scrollTop;
	}
else if (document.body && document.body.scrollTop){
	var Yscroll = document.body.scrollTop;
}
if (Yscroll == undefined){
	Yscroll = 0;
	}
var pathScheda = 'http://www.zeronovecomunicazione.it/web/scuolapercoach/includes/coach_certificati/';
var schedaName = pathScheda+paginaScheda;
		var alt = document.body.offsetHeight;
		document.getElementById('schedaInfoCoach').style.display = 'block';
		if(	document.getElementById('schedaInfoCoach').innerHTML = '<div id="winClose" onclick="chiudiScheda();"></div><iframe id="myFrame" width="400" height="250" hspace="0" vspace="0" frameborder="0" src="" scrolling="no"></iframe>'){
		document.getElementById('myFrame').src = schedaName;
		document.getElementById('schedaInfoCoach').style.left = posX+'px';
		document.getElementById('schedaInfoCoach').style.top = (posY+Yscroll)+'px';
		document.getElementById('bgBlack').style.display = 'block';
		document.getElementById('bgBlack').style.height = (alt+150)+'px';
		}
	}
	}
	
	function chiudiScheda(){
	if(document.getElementById){
		document.getElementById('schedaInfoCoach').innerHTML = '';
	document.getElementById('schedaInfoCoach').style.display = 'none';
	document.getElementById('bgBlack').style.display = 'none';
		document.getElementById('myFrame').src = '';
		document.getElementById('schedaInfoCoach').style.left = 0+'px';
		document.getElementById('schedaInfoCoach').style.top = 0+'px';
		}
	}