// holds an instance of XMLHttpRequest
var xmlHttp = createXmlHttpRequestObject();
// creates an XMLHttpRequest instance
function createXmlHttpRequestObject()
{
	// will store the reference to the XMLHttpRequest object
	var xmlHttp;
	// this should work for all browsers except IE6 and older
	try
	{
		// try to create XMLHttpRequest object
		xmlHttp = new XMLHttpRequest();
	}
	catch(e)
	{
		// assume IE6 or older
		var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",
		"MSXML2.XMLHTTP.5.0",
		"MSXML2.XMLHTTP.4.0",
		"MSXML2.XMLHTTP.3.0",
		"MSXML2.XMLHTTP",
		"Microsoft.XMLHTTP");
		// try every prog id until one works
		for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++)
		{
			try
			{
				// try to create XMLHttpRequest object
				xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
			}
			catch (e) {}
		}
	}
	// return the created object or display an error message
	if (!xmlHttp){
	alert("Error creating the XMLHttpRequest object.");
	}
	return xmlHttp;
}
function link_count(link_id){
	var serverPage = "articles/functions/count_links.php?id_num="+link_id;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");	
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{			
			var value = xmlHttp.responseText;			
		}
	}
	xmlHttp.send(null)
}
function send_mail_to_contractor(email_contractor,contractor_contact_name){
	var contact_email = document.getElementById('contact_email').value;
	var contact_phone = document.getElementById('contact_phone').value;
	var contact_note = document.getElementById('contact_note').value;
	var contact_name = document.getElementById('contact_name').value;
	
	alert("הפנייה נשלחה בהצלחה");
	var serverPage = "nadlan/mini-site/nadlan_contact_mail.php?advertiser_mail="+email_contractor+"&advertiser_name="+contractor_contact_name+"&email="+contact_email+"&full_name="+contact_name+"&phone="+contact_phone+"&message="+contact_note;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");	
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{			
			var value = xmlHttp.responseText;
			document.getElementById('contact_email').value = '';
			document.getElementById('contact_phone').value = '';
			document.getElementById('contact_note').value = '';
			document.getElementById('contact_name').value = '';			
		}
	}
	xmlHttp.send(null)
}

function show_filter_message_live(id,cookies_arr){	
	var serverPage = "functions/filter_user_message.php?id="+id+"&ck="+cookies_arr;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");	
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{			
		    var id_name = "other_result_"+id;			
			if(document.getElementById(id_name)==null)
			{
				var newdiv = document.createElement('div');
				newdiv.setAttribute('id', id_name);                
				//newdiv.innerHTML = cookies_arr;
				newdiv.innerHTML = xmlHttp.responseText;
				document.getElementById('user_person_message').appendChild(newdiv);
				var obj = document.getElementById(id_name);
				obj.style.display='';
				Drag.init(obj);
			}			
		}
	}
	xmlHttp.send(null)
}
function add_image_to_project(){
	if(document.getElementById('pic_15_view') == null){
		var number = 15;		
	}
	if(document.getElementById('pic_14_view') == null){
		var number = 14;		
	}
	if(document.getElementById('pic_13_view') == null){
		var number = 13;		
	}
	if(document.getElementById('pic_12_view') == null){
		var number = 12;		
	}
	if(document.getElementById('pic_11_view') == null){
		var number = 11;		
	}
	if(document.getElementById('pic_10_view') == null){
		var number = 10;		
	}
	if(document.getElementById('pic_9_view') == null){
		var number = 9;		
	}
	if(document.getElementById('pic_8_view') == null){
		var number = 8;		
	}
	if(document.getElementById('pic_7_view') == null){
		var number = 7;
	}
	if(document.getElementById('pic_6_view') == null){
		var number = 6;		
	}
	if(document.getElementById('pic_5_view') == null){
		var number = 5;
	}
	if(document.getElementById('pic_4_view') == null){
		var number = 4;
	}
	if(document.getElementById('pic_3_view') == null){
		var number = 3;
	}
	if(document.getElementById('pic_2_view') == null){
		var number = 2;		
	}
	if(document.getElementById('pic_1_view') == null){
		var number = 1;
		
	}
	if(number>=1 && number <=15){	    
	var serverPage = "nadlan/functions/add_image_to_project.php?num="+number;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");	
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{			
		    var id_name = "pic_"+number+"_view";			
			if(document.getElementById(id_name)==null)
			{
				var newdiv = document.createElement('div');
				newdiv.setAttribute('id', id_name);
                
				newdiv.innerHTML = xmlHttp.responseText;
				document.getElementById('td_pictures').appendChild(newdiv);
				var obj = document.getElementById(id_name);
                							
				var width = 314;
				//var height = 130;
				obj.style.width=width;
				obj.style.height=height;
				
				Drag.init(obj);
			}			
		}
	}
	xmlHttp.send(null)
	}
}
function add_property_to_project(){
	if(document.getElementById('property_8') == null){
		var number = 8;		
	}
	if(document.getElementById('property_7') == null){
		var number = 7;
	}
	if(document.getElementById('property_6') == null){
		var number = 6;		
	}
	if(document.getElementById('property_5') == null){
		var number = 5;
	}
	if(document.getElementById('property_4') == null){
		var number = 4;
	}
	if(document.getElementById('property_3') == null){
		var number = 3;
	}
	if(document.getElementById('property_2') == null){
		var number = 2;		
	}
	if(document.getElementById('property_1') == null){
		var number = 1;		
	}
	if(number>=1 && number <=8){	    
	var serverPage = "nadlan/functions/property_view.php?num="+number;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");	
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{			
		    var id_name = "property_"+number;			
			if(document.getElementById(id_name)==null)
			{
				var newdiv = document.createElement('div');
				newdiv.setAttribute('id', id_name);
                
				newdiv.innerHTML = xmlHttp.responseText;
				document.getElementById('td_property').appendChild(newdiv);
				var obj = document.getElementById(id_name);
                							
				var width = 314;
				var height = 130;
				obj.style.width=width;
				obj.style.height=height;
				
				Drag.init(obj);
			}			
		}
	}
	xmlHttp.send(null)
	}
}
function show_advance_message_float(id_number){
	var serverPage = "functions/show_advance_message.php?id="+id_number;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			var id_name = "show_advance_message_"+id_number;
			if(document.getElementById(id_name)==null)
			{
				
				var newdiv = document.createElement('div');
				newdiv.setAttribute('id', id_name);

				newdiv.innerHTML = xmlHttp.responseText;
				document.body.appendChild(newdiv);
				var obj = document.getElementById(id_name);

				var width = 587;
				var height = 400;
				obj.style.width=width;
				obj.style.height=height;	
				
				var top = document.documentElement.scrollTop+100;
				var left = 	(document.documentElement.clientWidth/2)-(width/2);

				obj.style.top=""+top+"px";
				obj.style.left=""+left+"px";

				obj.style.position='absolute';
				obj.style.zIndex="3";

				Drag.init(obj);
			}
			else
			{
				var obj = document.getElementById(id_name);
				var width = 587;
				var height = 400;
				obj.style.width=width;
				obj.style.height=height;	
				
				var top = document.documentElement.scrollTop+100;
				var left = 	(document.documentElement.clientWidth/2)-(width/2);


				obj.style.top=""+top+"px";
				obj.style.left=""+left+"px";
				obj.style.display='none';
				obj.style.display='';
			}
		}
	}
	xmlHttp.send(null)
}
function delete_logo_contractor(user){
    var agree=confirm("האם אתה בטוח שברצונך למחוק את הלוגו?")
	if(agree){
	   var serverPage = "functions/image_delete_logo.php?user="+user;
    	xmlHttp.open("GET",serverPage);
    	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
    	xmlHttp.onreadystatechange = function()
    	{
    		if(xmlHttp.readyState == 4  && xmlHttp.status == 200)
    		{		    
    		    document.getElementById('logo_image').style.display='none';
    		    document.getElementById('edit_logo').style.display='none';
    		    document.getElementById('delete_logo').style.display='none';
    		    document.getElementById('undo_edit_logo').style.display='none';    	
    		    document.getElementById('logo').style.display='';	    
    			var temp = xmlHttp.responseText;			
    		}
    	}
    	xmlHttp.send(null)        	
	}
	else{
		return false;
	}    
}
function delete_image(num,img_name,id){
    var agree=confirm("האם אתה בטוח שברצונך למחוק את התמונה?")
	if(agree){
	   var serverPage = "functions/image_delete.php?id="+id+"&img_name="+img_name;
    	xmlHttp.open("GET",serverPage);
    	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
    	xmlHttp.onreadystatechange = function()
    	{
    		if(xmlHttp.readyState == 4  && xmlHttp.status == 200)
    		{		    
    		    document.getElementById(img_name).style.display='';
    		    document.getElementById('delete_img_'+num).style.display='none';
    		    document.getElementById('edit_img_'+num).style.display='none';
    		    document.getElementById('edit_message_pic_'+num).style.display='none';    		    
    			var temp = xmlHttp.responseText;			
    		}
    	}
    	xmlHttp.send(null)        	
	}
	else{
		return false;
	}    
}
function message_restore(id,user){
	var serverPage = "functions/message_restore.php?id="+id+"&user="+user;
	xmlHttp.open("POST",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4  && xmlHttp.status == 200)
		{
		    alert("המודעה הוחזרה לפעילות.");
		    window.location = 'http://www.Tarazan.co.il?page=p_area&type=my_msg_close';
			var temp = xmlHttp.responseText;			
		}
	}
	xmlHttp.send(null)
}
function message_delay(id,user){	
	var agree=confirm("האם אתה בטוח שברצונך לסגור את המודעה?")
	if(agree){
		var serverPage = "functions/messages_delay.php?id="+id+"&user="+user;
    	xmlHttp.open("POST",serverPage);
    	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
    	xmlHttp.onreadystatechange = function()
    	{
    		if(xmlHttp.readyState == 4  && xmlHttp.status == 200)
    		{
    		    alert("המודעה הוקפאה בהצלחה.");
    		    window.location = 'http://www.Tarazan.co.il?page=p_area';
    			var temp = xmlHttp.responseText;			
    		}
    	}
    	xmlHttp.send(null)
	}
}
function message_delete(id,user){
    var agree=confirm("האם אתה בטוח שברצונך למחוק את המודעה?")
	if(agree){
		var serverPage = "functions/messages_delete.php?id="+id+"&user="+user;
    	xmlHttp.open("POST",serverPage);
    	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
    	xmlHttp.onreadystatechange = function()
    	{
    		if(xmlHttp.readyState == 4  && xmlHttp.status == 200)
    		{
    		    alert("המודעה נמחקה בהצלחה.");
    		    window.location = 'http://www.Tarazan.co.il?page=p_area';
    			var temp = xmlHttp.responseText;			
    		}
    	}
    	xmlHttp.send(null)
	}
}
function message_pop(id){    
    var serverPage = "functions/messages_pop.php?id="+id;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4  && xmlHttp.status == 200)
		{
		    alert("המודעה הוקפצה בהצלחה.");
		    window.location = 'http://www.Tarazan.co.il?page=p_area';
			var temp = xmlHttp.responseText;
		}
	}
	xmlHttp.send(null)
}
function nadlan_messages_count(nadlan_user){
    var obj = document.getElementById('nadlan_messages_count');
    var serverPage = "functions/nadlan_messages_count.php?user="+nadlan_user;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4  && xmlHttp.status == 200)
		{
			obj.innerHTML = xmlHttp.responseText;			
		}
	}
	xmlHttp.send(null)	
}
function user_messages_count(user){
    var obj = document.getElementById('user_messages_count');
    var serverPage = "functions/user_messages_count.php?user="+user;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4  && xmlHttp.status == 200)
		{
			obj.innerHTML = xmlHttp.responseText;
			user_messages_view_count(user);			
		}
	}
	xmlHttp.send(null)	
}
function user_messages_view_count(user){
    var obj = document.getElementById('user_messages_view');
    var serverPage = "functions/user_messages_view_count.php?user="+user;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4  && xmlHttp.status == 200)
		{
			obj.innerHTML = xmlHttp.responseText+" <span font-color='#FFFFFF'>פעמים</span>";
			setTimeout("user_messages_view_count('"+user+"')",10000);
		}
	}
	xmlHttp.send(null)
}
function countPP(id){
	var serverPage = "functions/message_count_plus.php?id="+id;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			var temp = xmlHttp.responseText;
		}
	}
	xmlHttp.send(null)
}
function draw_messages(type){    
    var serverPage = "functions/messages_view.php?message_type="+type;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
		    var id_name = "register_success";			
			if(document.getElementById(id_name)==null)
			{
				var newdiv = document.createElement('div');
				newdiv.setAttribute('id', id_name);
                
				newdiv.innerHTML = xmlHttp.responseText;
				document.body.appendChild(newdiv);
				var obj = document.getElementById(id_name);
                							
				var width = 314;
				var height = 130;
				obj.style.width=width;
				obj.style.height=height;	
				
				var top = document.documentElement.scrollTop+100;
				var left = 	(document.documentElement.clientWidth/2)-(width/2);


				obj.style.top=""+top+"px";
				obj.style.left=""+left+"px";

				
				obj.style.position='absolute';
				obj.style.zIndex="3";
				
				Drag.init(obj);
			}
			else
			{
				var obj = document.getElementById(id_name);
				
				var width = 314;
				var height = 130;
				obj.style.width=width;
				obj.style.height=height;	
				
				var top = document.documentElement.scrollTop+100;
				var left = 	(document.documentElement.clientWidth/2)-(width/2);
				obj.style.top=""+top+"px";
				obj.style.left=""+left+"px";

				obj.style.display='none';
				obj.style.display='';
			}
		}
	}
	xmlHttp.send(null)
}
function drawPictures(id_number){
	var serverPage = "functions/show_pictures.php?id="+id_number;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			var id_name = "drawPic_"+id_number;			
			if(document.getElementById(id_name)==null)
			{
				var newdiv = document.createElement('div');
				newdiv.setAttribute('id', id_name);

				newdiv.innerHTML = xmlHttp.responseText;
				document.body.appendChild(newdiv);
				var obj = document.getElementById(id_name);
						
				var width = 665;
				var height = 455;
				obj.style.width=width;
				obj.style.height=height;	
				
				var top = document.documentElement.scrollTop+100;
				var left = 	(document.documentElement.clientWidth/2)-(width/2);

				obj.style.top=""+top+"px";
				obj.style.left=""+left+"px";

				
				obj.style.position='absolute';
				obj.style.zIndex="3";
				
				Drag.init(obj);
			}
			else
			{
				var obj = document.getElementById(id_name);
				
				var width = 665;
				var height = 455;
				obj.style.width=width;
				obj.style.height=height;	
				
				var top = document.documentElement.scrollTop+100;
				var left = 	(document.documentElement.clientWidth/2)-(width/2);

				obj.style.top=""+top+"px";
				obj.style.left=""+left+"px";
				obj.style.display='none';
				obj.style.display='';
			}
		}
	}
	xmlHttp.send(null)
}
function contact_owner(id_number){
	var serverPage = "/functions/contact_owner.php?id="+id_number;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			var id_name = "ContactOwnder_"+id_number;			
			if(document.getElementById(id_name)==null)
			{
				var newdiv = document.createElement('div');
				newdiv.setAttribute('id', id_name);

				newdiv.innerHTML = xmlHttp.responseText;
				document.body.appendChild(newdiv);
				var obj = document.getElementById(id_name);

			
				var width = 543;
				var height = 543;
				obj.style.width=width;
				obj.style.height=height;	
				
				var top = document.documentElement.scrollTop+100;
				var left = 	(document.documentElement.clientWidth/2)-(width/2);

				obj.style.top=""+top+"px";
				obj.style.left=""+left+"px";
				
				obj.style.position='absolute';
				obj.style.zIndex="3";
				
				Drag.init(obj);
			}
			else
			{
				var obj = document.getElementById(id_name);
				var width = 543;
				var height = 543;
				obj.style.width=width;
				obj.style.height=height;	
				
				var top = document.documentElement.scrollTop+100;
				var left = 	(document.documentElement.clientWidth/2)-(width/2);

				obj.style.top=""+top+"px";
				obj.style.left=""+left+"px";
				obj.style.display='none';
				obj.style.display='';
			}
		}
	}
	xmlHttp.send(null)
}
function report_error(id_number){
	var serverPage = "functions/report_error.php?id="+id_number;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			var id_name = "ReportError_"+id_number;			
			if(document.getElementById(id_name)==null)
			{
				var newdiv = document.createElement('div');
				newdiv.setAttribute('id', id_name);

				newdiv.innerHTML = xmlHttp.responseText;
				document.body.appendChild(newdiv);
				var obj = document.getElementById(id_name);

				var width = 543;
				var height = 371;
				obj.style.width=width;
				obj.style.height=height;	
				
				var top = document.documentElement.scrollTop+100;
				var left = 	(document.documentElement.clientWidth/2)-(width/2);

				obj.style.top=""+top+"px";
				obj.style.left=""+left+"px";
				
				obj.style.position='absolute';
				obj.style.zIndex="3";
				
				Drag.init(obj);
			}
			else
			{
				var obj = document.getElementById(id_name);
				var width = 543;
				var height = 371;
				obj.style.width=width;
				obj.style.height=height;	
				
				var top = document.documentElement.scrollTop+100;
				var left = 	(document.documentElement.clientWidth/2)-(width/2);
				obj.style.top=""+top+"px";
				obj.style.left=""+left+"px";
				obj.style.display='none';
				obj.style.display='';
			}
		}
	}
	xmlHttp.send(null)
}
function send_report_error(id){
    var full_name = document.getElementById('report_error_full_name_'+id).value;
    var phone = document.getElementById('report_error_phone_'+id).value;
    var email = document.getElementById('report_error_email_'+id).value;
    var note = document.getElementById('report_error_note_'+id).value;
    
    var serverPage = "functions/send_report_error.php?id="+id+"&full_name="+full_name+"&phone="+phone+"&email="+email+"&note="+note;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
		    var temp = xmlHttp.responseText;
		    document.getElementById('ReportError_'+id).style.display = "none";
		}
	}
	xmlHttp.send(null)
}
function send_contact_owner(id){
    var full_name = document.getElementById('contact_owner_full_name_'+id).value;
    var phone = document.getElementById('contact_owner_phone_'+id).value;
    var email = document.getElementById('contact_owner_email_'+id).value;
    var note = document.getElementById('contact_owner_note_'+id).value;
    var toEmail = document.getElementById('to_email_'+id).value;
    
    var serverPage = "/functions/send_contact_owner.php?id="+id+"&to_email="+toEmail+"&full_name="+full_name+"&phone="+phone+"&email="+email+"&note="+note;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
		    var temp = xmlHttp.responseText;
		    document.getElementById('ContactOwnder_'+id).style.display = "none";
		}
	}
	xmlHttp.send(null)
}

function send_contact_us(){
    var full_name = document.getElementById('contact_full_name').value;
    var subject = document.getElementById('contact_subject').value;
    var phone = document.getElementById('contact_phone').value;
    var phone_type = document.getElementById('contact_phone_type').value;
    var email = document.getElementById('contact_email').value;
    var note = document.getElementById('contact_note').value;
    
    var serverPage = "functions/send_contact_us.php?full_name="+full_name+"&subject="+subject+"&phone="+phone+"&phone_type="+phone_type+"&email="+email+"&note="+note;
	xmlHttp.open("GET",serverPage);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
		    var temp = xmlHttp.responseText;
		    window.location = "/index.php";
		}
	}
	xmlHttp.send(null)
}
