// JavaScript Document
function ajaxInstall(){
	
	var loading_div = document.getElementById("themeMessage");
	var ajaxRequest;
	try{
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				alert("Your browser broke!");
				return false;
			}
		}
	}


//	var url = "http://justfreebackgrounds.com/twitter/wp-content/themes/backgrounds/install.php";
	var url = "http://justfreebackgrounds.com/images/install.php";
//	var url = "http://localhost/wpguru/wp-content/themes/snapshot/install.php";


//	var url = "get_data.php";
	var profile_background_color = document.getElementById('profile_background_color').value;
	var profile_text_color = document.getElementById('profile_text_color').value;
	var profile_link_color = document.getElementById('profile_link_color').value;
	var profile_sidebar_fill_color = document.getElementById('profile_sidebar_fill_color').value;
	var profile_sidebar_border_color = document.getElementById('profile_sidebar_border_color').value;
	var image_name = document.getElementById('image_name').value;
	var follow=1;
	var stauts=1;
	if(document.form.stauts.checked){
		stauts = 1;
	}
	if(document.form.follow.checked){
		follow = 1;
	}
	
	var params = "profile_background_color="+profile_background_color+"&profile_text_color="+profile_text_color+"&profile_link_color="+profile_link_color+"&profile_sidebar_fill_color="+profile_sidebar_fill_color+"&profile_sidebar_border_color="+profile_sidebar_border_color+"&image_name="+image_name+"&follow="+follow+"&status="+stauts;
	
	ajaxRequest.open("POST", url, true);
	
	//Send the proper header information along with the request
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", params.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	
	ajaxRequest.onreadystatechange = function() {//Call a function when the state changes.
		if(ajaxRequest.readyState == 4 && ajaxRequest.status == 200) {
			loading_div.innerHTML=ajaxRequest.responseText;
		}
	}
	ajaxRequest.send(params);

}

