window.onload = init;
var active_ClassName = '';
var active_Row = null;

function init()
{
	open_Dialog();
}

function open_Dialog()
{
   document.getElementById("divLoginDialog").style.display = "";
   resizeModal();
   document.getElementById("ifrm").src = 'login.aspx';

   // Add a resize handler for the window
   window.onresize = resizeModal;
}

function resizeModal()
{
	// Resize the div which fakes the modality of the dialog div
	document.getElementById("divModal").style.width = document.body.scrollWidth + "px";
	document.getElementById("divModal").style.height = document.body.scrollHeight + "px";
	
	// Re-center the dialog div
	document.getElementById("divLoginDialog").style.left = ((document.body.offsetWidth - document.getElementById("divLoginDialog").offsetWidth) / 2) + "px";
	document.getElementById("divLoginDialog").style.top = 124 + "px";
	document.getElementById("ifrm").style.height = "280px"; //(window.screen.height-(document.body.scrollHeight/4)) + "px";
	document.getElementById("divLoginDialog").style.height = (parseInt(document.getElementById("ifrm").style.height)+28) + "px";
}
// Cross-Browser functions
//----------------------------------------------------
function get_ElementID(str_ID)
{
	var obj_Element = document.getElementById(str_ID);
	//if(obj_Element==null) { alert('Element id: \"' + str_ID + '\" does not exit.'); }
	return(obj_Element);
}

function get_TagElements(str_ID)
{
	var arry_TagElements = document.getElementsByTagName(str_ID);
	if(arry_TagElements==null) { alert('Tag id: \"' + str_ID + '\" does not exit.'); }
	return(arry_TagElements);
}

function get_EventSourceElement(obj_Event)
{
	try
	{ return(obj_Event.explicitOriginalTarget); } // Mozilla, Safari, ...
	catch(e)
	{ return(window.event.srcElement); } // IE
}

function get_ElementInnerText(obj_Element)
{
	return(obj_Element.textContent ? obj_Element.textContent : obj_Element.innerText);
}
//--------------------------------------------------------
