//----------------------------------------------
//  load the lightbox.css
//----------------------------------------------

var lightbox_object;

var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body

var headID = document.getElementsByTagName("head")[0];
var cssNode = document.createElement('link');cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.href = '/css/lightbox.css';
cssNode.media = 'screen';
headID.appendChild(cssNode);

function create_div(p1) {
	if (document.getElementById(p1)==undefined) {
		var new_div = document.createElement("div");
		new_div.id = p1;
		document.body.appendChild(new_div);
	}
}


function lightbox_show(p_title,p_iframe,c_text, p_title_extra) {



	create_div('lightbox_content');
	create_div('lightbox_fading');


	var c_html = "";

	c_html += "<div id='lightbox_titlebar'>";

	c_html += "<div id='lightbox_title'>" + p_title;

	if (p_title_extra!=undefined) {
		c_html += ' '+ p_title_extra;
	}
	c_html += "</div>";

	c_html += "<div id='close'><a href =javascript:void(0); onclick='lightbox_close();'><img src='/grfx/close_btn.gif' border='0' /></a></div>";
	c_html += "</div>";
	c_html += "<div id='clear'></div>";

	if (p_iframe !='') {
		c_html += "<iframe src='" + p_iframe + "' name='lightbox' scrolling='auto' frameborder='no' id='lightbox_iframe'></iframe>";
	} else {
	 	c_html += c_text;
	}

	document.getElementById('lightbox_content').innerHTML= c_html;
	document.getElementById('lightbox_content').style.display='block';
	document.getElementById('lightbox_content').style.top = document.all? (iebody.scrollTop+15)+'px' : (pageYOffset+15)+'px';

	document.getElementById('lightbox_fading').style.height = document.body.scrollHeight+'px';

	document.getElementById('lightbox_fading').style.display='block';

	lightbox_object = setInterval("positionit()",1);

}

function positionit() {
	var dsoctop=document.all? iebody.scrollTop : pageYOffset
	if (document.all||document.getElementById) {
		document.getElementById('lightbox_content').style.top=(dsoctop+15)+"px"
	}
}

function lightbox_close() {
	document.getElementById('lightbox_content').style.display='none';
	document.getElementById('lightbox_fading').style.display='none';
	clearInterval(lightbox_object);
}

