var lightbox1_width = 730, lightbox1_height= 100;
var theTop = 0;
var old = 0;

function showMultipleLightbox( iddiv ){
	if(iddiv != 'login'){
		document.location.href='access.php?'+query_string;
		return true;
	}

	if( document.getElementById('video') ) document.getElementById('video').style.display="none";
	
	if( document.getElementById('flash') ) document.getElementById('flash').style.display = 'none';
	
	if( document.getElementById('combocat') ) document.getElementById('combocat').style.display = 'none';
	
	if(document.getElementById("ov_center")) document.getElementById("ov_center").style.display = "block";

	if(document.getElementById("flashcontent")) document.getElementById("flashcontent").style.display = "none";
	
	document.getElementById('overlay').style.display = 'block';
	
	if(document.getElementById(iddiv)){
		document.getElementById(iddiv).style.display = 'block';
	}
	else{
		if(document.getElementById('dialer_faq_join')) document.getElementById('dialer_faq_join').style.display = 'block';
	}

	LoadURL("templates_globales/set_visit.php?p="+access_visit,"");

}

function hideMultipleLightbox( iddiv ){
	
	document.getElementById('overlay').style.display = 'none'; // hide lightbox and overlay
	
  	if(document.getElementById(iddiv)) document.getElementById(iddiv).style.display = 'none';
  	
   	if(document.getElementById("ov_center")) document.getElementById("ov_center").style.display = "none";
   	
	if( document.getElementById('video') ) document.getElementById('video').style.display="block";
	
	if( document.getElementById('flash') ) document.getElementById('flash').style.display = 'block';
	
	if( document.getElementById('combocat') ) document.getElementById('combocat').style.display = 'block';

	if(document.getElementById("flashcontent")) document.getElementById("flashcontent").style.display = "block";
	
}


function showLightbox(){
	if(document.getElementById('dialer_faq_join'))
		showMultipleLightbox( 'dialer_faq_join' );
	else
		showMultipleLightbox( 'join' );
}

function hideLightbox(){
	if(document.getElementById('dialer_faq_join'))
		hideMultipleLightbox( 'dialer_faq_join' );
	else
		hideMultipleLightbox( 'join' );
}

function showDivLightbox(){
	showMultipleLightbox( 'join' );
}

function showMembersLightbox(){
	showMultipleLightbox('infol_lightbox');
}

function hideMembersLightbox(){
	hideMultipleLightbox('infol_lightbox');
}

function movelayer() {return true;
	var pos;

	if (window.innerHeight) {
		  pos = window.pageYOffset
	} else if (document.documentElement && document.documentElement.scrollTop) {
		pos = document.documentElement.scrollTop
	} else if (document.body) {
		  pos = document.body.scrollTop
	}

	if (pos < theTop)
		pos = theTop
	else
		pos += 15
	if (pos == old)
		document.getElementById("lightbox1").style.top = pos + "px"

	old = pos
	setTimeout("movelayer()",10);
}

function getPageScroll(){
	var theTop = 0;
	var old = 0;

	if (window.innerHeight) {
		pos = window.pageYOffset
	} else if (document.documentElement && document.documentElement.scrollTop) {
		pos = document.documentElement.scrollTop
	} else if (document.body) {
		pos = document.body.scrollTop
	}
	return pos;
}

function getPageSize(){
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}

function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}
