function entsub(myform) {if (window.event && window.event.keyCode == 13){chkUserSignIn();}}
function chkUserSignIn(){
	var signInMess = ''	
	if ( document.getElementById('username').value=='' || document.getElementById('username').value==null ){
		signInMess += "Username" + '\n'
	}
	if ( document.getElementById('password').value=='' || document.getElementById('password').value==null ){
		signInMess += "Password" + '\n'
	}
	if (signInMess != ''){alert('Please fill in the required fields before submitting: \n\n'+signInMess)
	}else{document.getElementById('frmLogin').submit()}
}
var xmlHttpEmail
function promptEmail(){
	var userEmail = prompt('Enter your email')
	if (userEmail == null) {
	}else {
		if (userEmail != '' && userEmail != null) {alertPassSent(userEmail,document.getElementById('usertype').value)
		}else{alert('Please enter a valid email address.')}
	}
}
function alertPassSent(email,usertype){ 
xmlHttpEmail=GetXmlHttpObject()
if (xmlHttpEmail==null){
 alert ("Browser does not support HTTP Request")
 return
} 
var url="_includes/forgotPassword.php"
url=url+"?usertype="+usertype
url=url+"&email="+email
xmlHttpEmail.onreadystatechange=stateChangedEmail
xmlHttpEmail.open("GET",url,true)
xmlHttpEmail.send(null)
}
function stateChangedEmail() { 
	if (xmlHttpEmail.readyState==4 || xmlHttpEmail.readyState=="complete"){ 
		document.getElementById("forgotPassMess").value=xmlHttpEmail.responseText 
		alert (document.getElementById('forgotPassMess').value)//alert what we get from forgotPassword.php
	}
}
function GetXmlHttpObject(){
var xmlHttpEmail=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttpEmail=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttpEmail=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttpEmail=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttpEmail;
}
//article
function showArt(divId){
	var dProp = document.getElementById(divId).style.display
	if ( dProp == 'block' ){document.getElementById(divId).style.display = 'none'
	}else{document.getElementById(divId).style.display = 'block'}
}
function hideArt(divId){document.getElementById(divId).style.display = 'none'}
function highLight(topicId){document.getElementById(topicId).style.backgroundColor = '#FFCC99'}
function defLight(topicId){document.getElementById(topicId).style.backgroundColor = '#FFFFFF'}
//from index..
function chkFrmSReply(){
	if ( document.getElementById('txtSReply').value == '' ){
		alert('You have submitted a blank form. Please enter \na valid question and click on the SUBMIT button. \nThank you.')
	}else{document.frmSReply.submit();}
}
function revealModal(divID){
    document.getElementById('queryTo1').style.visibility = 'hidden'
	window.onscroll = function () { document.getElementById(divID).style.top = document.body.scrollTop; };
    document.getElementById(divID).style.display = "block";
    document.getElementById(divID).style.top = document.body.scrollTop;
	document.getElementById('modalBackground').style.height = 2 * screen.height + 3000 + "px"//covering the page, gray color
	document.getElementById('modalContainer').style.left = document.body.clientWidth/2 + 12 + "px"
}
function hideModal(divID)
{document.getElementById(divID).style.display = "none";}
/*bubble*/
function showToolTip(e,text, imgId){
	var divToolTip = document.getElementById('bubble_tooltip');
	var offsetTrail = document.getElementById(imgId);
    var offsetLeft = 0;
    var offsetTop = 0;
    while (offsetTrail) {
        offsetLeft += offsetTrail.offsetLeft;
        offsetTop += offsetTrail.offsetTop;
        offsetTrail = offsetTrail.offsetParent;
    }
    if (navigator.userAgent.indexOf("Mac") != -1 && 
        typeof document.body.leftMargin != "undefined") {
        offsetLeft += document.body.leftMargin;
        offsetTop += document.body.topMargin;
    }
	if(document.all)e = event;
	var obj = document.getElementById('bubble_tooltip');
	var obj2 = document.getElementById('bubble_tooltip_content');
	obj2.innerHTML = text;
	obj.style.display = 'block';
	if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
	var leftPos = e.clientX - 100;
	if(leftPos<0)leftPos = 0;
	obj.style.left = offsetLeft-50+'px';
	obj.style.top = offsetTop-80+'px';//change the red number to current image height
}	
function hideToolTip(){document.getElementById('bubble_tooltip').style.display = 'none';}