	var xmlHttp = false;
	if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
		xmlHttp = new XMLHttpRequest();
	}
	
	function callServer(id) {
		document.getElementById('focus_site').innerHTML = '<label>loading...</label>';
		
		var url = "ajax_agent.php?site="+id;
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = updatePage;
		xmlHttp.send(null);
	}

	

	function updatePage() {
		if (xmlHttp.readyState == 4) {
			var response = xmlHttp.responseText;
			document.getElementById('focus_site').innerHTML = response;
			$('#focus_site').fadeIn();
		}
	}

	function changeBg(img_src) {
		document.body.style.background = img_src;
	}
	
	function toggleContactForm() {
		if(document.getElementById("contact").style.display == 'block') {
			//document.getElementById("contact").style.display = 'none';
			$('#contact').fadeOut();
			document.getElementById("contact_link").innerHTML = 'Contact Me';
		} else {
			if((document.getElementById("contact").innerHTML).substring(5,6) != ' ') { //* βΛΕ΄ΏΝΓμΑγΛΑθΝΥ‘ΓΝΊ
				var url = "ajax_agent.php?act=load_form";
				xmlHttp.open("GET", url, true);
				xmlHttp.onreadystatechange = updatePage3;
				xmlHttp.send(null);
			}
			$('#contact').fadeIn();
			document.getElementById("contact_link").innerHTML = 'Cancel';
		}
	}

	
	function updatePage3() {
		if (xmlHttp.readyState == 4) {
			var response = xmlHttp.responseText;
			document.getElementById("contact").innerHTML = response;
			$('#contact').fadeIn();
		}
	}
	
	
	function callServer2() {
		//var url = "ajax_agent.php?act=send&name="+ document.form['form_main'].name.value + "email=" + document.form['form_main'].email.value + "message=" + document.form['form_main'].message.value;
		var url = "ajax_agent.php?act=send&name="+ document.getElementById('name').value + "&email=" + document.getElementById('email').value + "&message=" + document.getElementById('message').value;
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = updatePage2;
		xmlHttp.send(null);
		
		document.getElementById("contact").innerHTML = '<form>sending</form>';
	}
	
	function updatePage2() {
		if (xmlHttp.readyState == 4) {
			var response = xmlHttp.responseText;
			document.getElementById("contact").innerHTML = response;
			document.getElementById("contact_link").innerHTML = 'Close';
		}
	}
	
	
