function openLightBox(div_id,open_url,pass_data)
{	
	myWidth = document.getElementById('theDoc').offsetWidth;
	myHeight = document.getElementById('theDoc').scrollHeight;
	
	myHeight = (myHeight > screen.height) ? myHeight : screen.height;
	myHeight = myHeight + 150;
	
	if(document.getElementById('light-weight') == null)
	{
		model_img = document.createElement('img');
		model_img.setAttribute('src','/images/topbg.gif');
		model_img.setAttribute('id','light-weight');
		model_img.setAttribute('width',myWidth);
		model_img.setAttribute('height',myHeight);
		model_img.setAttribute('z-index',1100);
		model_img.style.top = 0;
		model_img.style.position = "absolute";
		model_img.style.filter="alpha(opacity=70)";
		model_img.style.MozOpacity = '0.7';
		model_img.style.opacity = '0.7';
		document.body.appendChild(model_img);
	}
	if(screen.width>810)
		document.getElementById(div_id).style.left = ((screen.width-810)/2)+'px';
	document.getElementById(div_id).style.display = "block";

	global_div = div_id;
	global_url = open_url;
	if(open_url != '')
		handle_ajax(open_url,pass_data);
}

function handle_ajax(open_url,pass_data)
{
	xmlHttp = GetXmlHttpObject();
	open_url = '/'+open_url;
	open_url += '?'+pass_data;
	document.getElementById(global_div).innerHTML = '<div style="width:100%;" align="center"><img src="/images/loader_v2.gif"></div>';
	
	xmlHttp.onreadystatechange = showAjaxResp
	xmlHttp.open("GET",open_url,true)
	xmlHttp.send(null)
}

function showAjaxResp()
{
	if(xmlHttp.readyState == 4)
	{
		document.getElementById(global_div).innerHTML = xmlHttp.responseText;
	}
}

function closeLightBox()
{
	document.body.removeChild(model_img);
	if(global_url != '')
		document.getElementById(global_div).innerHTML = "";
	document.getElementById(global_div).style.display = "none";
}
