var regFormErrors = 0;
var Selected_meuser = '';

var SelectMeuserNotUsed = false;
function show_LoginDiv() {
	
	
	if(document.getElementById('reg_form')){
		document.getElementById('reg_form').style.display='block'
	}
	if(document.getElementById('reg_wait')){
		document.getElementById('reg_wait').style.display='none'
	}
	if(document.getElementById('reg_forminner')){
		document.getElementById('reg_forminner').style.display='block'
	}
	if(document.getElementById('reg_form')){
		document.getElementById('reg_form').style.visibility = "visible"
	}
	if(document.getElementById('reg_wait')){
		document.getElementById('reg_wait').style.visibility = "hidden"
	}
	if(document.getElementById('reg_forminner')){
		document.getElementById('reg_forminner').style.visibility = "visible"
	}
	disable(true);
}
function close_LoginDiv(location) {
	if(document.getElementById('regForm')){
		unmarkError_all();
		document.getElementById('regForm').reset();
	}
	
	if(document.getElementById('reg_form')){
		document.getElementById('reg_form').style.display='none';
	}
	if(document.getElementById('reg_wait')){
		document.getElementById('reg_wait').style.display='none';
	}
	if(document.getElementById('reg_forminner')){
		document.getElementById('reg_forminner').style.display='none';
	}
	if(document.getElementById('reg_form')){
		document.getElementById('reg_form').style.visibility = "hidden"
	}
	if(document.getElementById('reg_wait')){
		document.getElementById('reg_wait').style.visibility = "hidden"
	}
	if(document.getElementById('reg_forminner')){
		document.getElementById('reg_forminner').style.visibility = "hidden"
	}
	if(location != page_name_url)
	{
		top.location = location;
	}
	disable(false);
}

function printLoginDiv()
{
	try
	{
	document.write('<div class="popup" align="center" id="reg_form" style="display:none">');
	document.write('<div class="filter" align="center">');
	document.write('</div>');
	document.write('<div class="plogin" id="reg_forminner" align="center">');
	document.write('<div align="center">');
		document.write('<br />');
		document.write('<div>');
			
			document.write('<div class="pheader" onclick="close_LoginDiv(\''+page_out+'\')">');
			
				document.write('<div class="pcornr">');
					document.write('<div class="pcornl">');
						document.write('<div class="prit">');
	document.write('&nbsp; <b>تسجيل الدخول</b></div>');
						document.write('<div class="plft">');
							document.write('<span class="pcrsr"><b>x</b> إغلاق</span>&nbsp;');
						document.write('</div>');
					document.write('</div>');
				document.write('</div>');
				document.write('</div>');
				document.write('<iframe id="login" class="login" width="515px" scrolling="no" height="230" frameborder="0" align="middle" marginheight="0" marginwidth="0" src="https://ldap.maktoob.com/ldap_login2/ServiceLoginBox.php?location='+page_name_url+'&channel='+channel+'&thchPk='+thchPk+'&maktoobfield='+regChannelName+'&rm='+Math.floor(1000000*Math.random())+'"></iframe>');
	
			document.write('</div>');
	
	document.write('</div>');
	
	document.write('</div>');
	
	document.write('</div>');
	document.write('<br class="end" />');
	
	}
	catch(e){}
}
function disable(disableIt)
{
	var selects = document.getElementsByTagName("select");
	for(var i=0;i<selects.length;i++)
	{
		var item = selects[i];
		item.disabled = disableIt;
	}
}
printLoginDiv();
