//Close whitebox Function
function WbClose(lang)
{	
	if(lang == 'fr'){ var str = 'Chargement de l\'image...'; }else{ var str = 'Loading image...'; }
	document.getElementById('wrapper').style.display = 'none';
	document.getElementById('wbox').style.display = 'none';
	document.getElementById('wrapper').innerHTML = '<table class="popupBox" border="0" cellspacing="0" cellpadding="0"><tr><td>'+ str +'</td></tr></table>';
}

//whitebox Function
function whitebox(path)
{

//Variable Data
var page, viewportHeight, extraHeight, topPosition, full, scroll, top;


//Object Data
var wbox					= document.getElementById('wbox');
var wboxWrapper				= document.getElementById('wrapper');

//Define Viewport Height
scroll 						= document.getElementById('main').scrollHeight;

function getScrollXY() {
  scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;

  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;

  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;

  }
  return scrOfY;
}


//Set wbox Height
wbox.style.height 			= scroll + 'px';
wbox.style.display 			= 'block';
wboxWrapper.style.top		= getScrollXY()  + 'px';

//Clear content to prevent flickering
wboxWrapper.style.display 	= 'block';

fnLoadWb(path,'wrapper');



}

// // // // //


// // // // //
// // // // //
// // // // //

//Variable Data
var reqt = false;

// // // // //

//fnLoad Function
function fnLoadWb(link,container){

cont = container;

//Check Supported Browser
try { reqt = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); }

//When Not Supported
catch(e){ alert('Unfortunatelly you browser doesn\'t support this feature!'); }

//Check Loaded Status
reqt.onreadystatechange = fnCheckWb;

//Open Link
reqt.open('POST',link);

//Send
reqt.send('');
} 

// // // // //

//fnCheck Function
function fnCheckWb(){

//When Loaded
if((reqt.readyState == 4) && (reqt.status == 200)){

//Output
document.getElementById(cont).innerHTML = reqt.responseText;

//???
//document.getElementById('wbox').style.display = 'block';
//document.getElementById('wbox-content').style.marginLeft = -((document.getElementById('wbox-photo').width + 20 ) / 2) + 'px';

}

}