function lostPass(){
	aaa = document.getElementById('lost_pass')
	aaa.style.display='block'
	setTimeout("document.getElementById('lost_pass').style.display='none'",7000)
	}

function login(){
	document.getElementById('gear').style.display='block'
	var zzz = document.splash_login.getElementsByTagName('input');
	var email = zzz[0];
	var pass = zzz[1];
	if(email.value == '' | pass.value == ''){
		alert('No Blank Fields')
		document.getElementById('gear').style.display='none'
		return
		}
	aaa = email.value;
	bbb = hex_md5(pass.value);
	ccc = 'login'
	
	var xxx = new Array
	xxx[0]='email'
	xxx[1]=aaa
	xxx[2]='pass'
	xxx[3]=bbb
	loginSend('login',xxx)
	return false;
	}


/////////////////////////////////
////////// ajax response scripts

function responseLogin(){
	window.location = window.location.href
	}
	
function wrongPass(){
	document.getElementById('gear').style.display='none'
	alert('Wrong Password')
	}

function unknownUser(){
	document.getElementById('gear').style.display='none'
	alert('Unkown User')
	}

	
///////////////////////////////
////////////////// AJAX Login
function loginSend(select,xxx){

	xmlHttp=GetXmlHttpObject()
		
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request")
	 return
	 }
	var url="splash/login_a.php"
	url=url+"?select="+select
	url=url+"&sid="+Math.random()
	for(i=0;i<xxx.length;i=i+2){
	j=i+1
	url=url+"&"+xxx[i]+"="+xxx[j]
	}
	
	xmlHttp.onreadystatechange=xmlFunction
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
	}

/////// http response

function GetXmlHttpObject()
	{
	var xmlHttp=null;
	try
	 {
	 // Firefox, Opera 8.0+, Safari
	 xmlHttp=new XMLHttpRequest();
	 }
	catch (e)
	 {
	 //Internet Explorer
	 try
	  {
	  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	 catch (e)
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	 }
	return xmlHttp;
	}

function xmlFunction(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		xmlTEXT = xmlHttp.responseText;
		xmlDoc = xmlHttp.responseXML;
			if(xmlDoc.getElementsByTagName("script_type")[0].childNodes[0].nodeValue=='JSON'){
				functions_A = xmlDoc.getElementsByTagName("script_func");
					for(i=0;i<functions_A.length;i++){
						var JSON = functions_A[i].getElementsByTagName('JSON_object')[0].firstChild.nodeValue
						var JSONobj = eval('('+JSON+')')
						
						doFunc = eval(functions_A[i].getElementsByTagName("function_name")[0].childNodes[0].nodeValue)
						doFunc(JSONobj.array)
				}	
			} else if (xmlDoc.getElementsByTagName("script_type")[0].childNodes[0].nodeValue=='JAVASCRIPT') {
					functions_A = xmlDoc.getElementsByTagName("script_func");
					for(i=0;i<functions_A.length;i++){				
						doFunc = eval(functions_A[i].getElementsByTagName("function_name")[0].childNodes[0].nodeValue)
						doFunc()
					}
				//document.getElementById('notice').firstChild.nodeValue = xmlDoc.getElementsByTagName("response_notice")[0].firstChild.nodeValue
			}	
		}
	}

