function doajax(file) {
	var xmlHttp;
	if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
		else if (window.ActiveXObject) {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		else {
			alert ("Brower error");
			return false;
		}
	 
		xmlHttp.onreadystatechange = function () {
			if(xmlHttp.readyState==4){
				var resultarea= document.getElementById('right');
				resultarea.innerHTML=xmlHttp.responseText;
			}
			else {
				var area= document.getElementById('right');
				area.innerHTML = "<img src='images/indicate.gif'><br> Please wait";
			}
		}
		xmlHttp.open("GET",file,true);
		xmlHttp.send(null);
	}
	
function expand(sec)
{
     thisSec = 'pionic'+sec
	 thisSec = document.getElementById(thisSec);
     if (thisSec != null){
          if (thisSec.length){
               if (thisSec[0].style.display != 'none'){
                    for (var i=0;i<thisSec.length;i++) {thisSec[i].style.display = 'none'}
               }
               else{
                    for (var i=0;i<thisSec.length;i++) {thisSec[i].style.display = 'inline'}
               }
          }
          else{
                         if (thisSec.style.display != 'none')     {thisSec.style.display = 'none'}
               else{thisSec.style.display = 'inline'}
          }
     }

}

function chk () {
		user = document.register.username.value;
		pwd = document.register.password.value;
		name = document.register.firstname.value;
		last = document.register.lastname.value;
		email = document.register.email.value;
		vemail = document.register.veremail.value;
		if (user =='') {
			alert('Please enter username');
			document.register.username.focus();
			return false;
		}
		if (pwd =='') {
			alert('Please enter password');
			document.register.password.focus();
			return false;
		}
		if (name =='') {
			alert('Please enter your name');
			document.register.firstname.focus();
			return false;
		}
		if (last =='') {
			alert('Please enter your lastname');
			document.register.lastname.focus();
			return false;
		}
		if (email != vemail || email == '') {
			alert ('Please check email');
			document.register.veremail.focus();
			return false;
		}
}

function chklogin () {
		user = document.lg.username.value;
		pwd = document.lg.password.value;
		
		if (user =='') {
			alert('Please enter username');
			document.lg.username.focus();
			return false;
		}
		if (pwd =='') {
			alert('Please enter password');
			document.lg.password.focus();
			return false;
		}
		
}
