/*
DON'T CHANGE ANYTHING BELOW THIS LINE UNLESS YOU ARE YOU WHAT YOU ARE DOING.
ANY MODIFICATIONS MAY CAUSE THE SCRIPT NOT TO WORK PROPERLY, OR NOT AT ALL
*/
function show(sourceP,titleS)/* used to display the pop-up layer, receives the target and a title for the pop-up as parameters */
{
	sourceLOC='contentSource_'+sourceP;
	sourceDIV=document.getElementById(sourceLOC);
	sourceVAL=sourceDIV.innerHTML;
	
	mainDiv=document.getElementById('pop-open');
	doPosition(mainDiv,570,520);
	
	destDIV=document.getElementById('content');
	destDIV.innerHTML=sourceVAL;

	destDIV_title=document.getElementById('main_title');
	destDIV_title.innerHTML=titleS;
	
	document.getElementById('pop-open').style.display = "";
}
function inIE() {
	return navigator.appName == "Microsoft Internet Explorer";
}
function getScrollXY() {/* calculates scroll offset ; i.e: the place where the user is, down the page, after using the scroll bar */
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}

function doPosition(obj,winW,winH) /* calculates and move the obj passed object to the correct center of an area defined by winW(width) and winH (height) */
{	
//alert(navigator.appName);
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winnW = window.innerWidth;
	  winnH = window.innerHeight;
	 }
	 if (navigator.appName=="Microsoft Internet Explorer") {
	  winnW = document.body.offsetWidth;
	  winnH = document.body.offsetHeight;
	  //alert(winnH);
	 }
	}
	obj.style.width=winW+'px';
	obj.style.height=winH+'px';
	
	y=(winnH-570) / 2;//screen.availHeight
	x=(winnW-520) / 2;//screen.availWidth
//	x=(screen.availWidth/2) - (570 / 2);
	//alert(x +'==-------=='+ y);
	offsets=getScrollXY();
	y=y+offsets[1];
	
	if( inIE() ) 
		obj.style.left=(x-50)+'px';
	else
		obj.style.left=(x-50)+'px';
		
	obj.style.top=y+'px';
	
}
function hide(objID) /* function to hide any html object */
{
	document.getElementById(objID).style.display = "none";
}