      //Common Codes
      // Get the HTTP Object
	function getHTTPObject(){
	
		if (window.ActiveXObject) 
			return new ActiveXObject("Microsoft.XMLHTTP");
	  
		else if (window.XMLHttpRequest) return new XMLHttpRequest();
		else {
			alert("Your browser does not support AJAX.");
			return null;
		}
	}
	//Common Codes
	   
      
      //Editable Sectiion
      //Ajax Functions called
	//To Get SiteBuilder Step2
      	function getsiteStep2()
	{
		httpObject = getHTTPObject();
		
		if (httpObject != null) 
		{
			var domain_choice	= $("input[name='SubDomain']:checked").val();
			//alert(domain_choice);
			var merchant	=	document.getElementById('merchant').value;
			httpObject.open("GET", "sitebuilder_step2.php?merchant="+merchant+"&domain="+domain_choice, true);
			httpObject.send(null);
			httpObject.onreadystatechange = showStep2;
		
		}
	
	}
	
	// Used for sitebuilderstep2
	function showStep2()
	{
		if(httpObject.readyState == 4)
		{
			$('#divright').hide();
			document.getElementById("step1_id").style.display = "none";
			document.getElementById("step2_id").style.display = "block";
			document.getElementById("step2_id").innerHTML	=	 httpObject.responseText;
		}
	}


	//To Get SiteBuilder Step2
      	function validateDomain()
	{
		httpObject = getHTTPObject();
		
		if (httpObject != null) 
		{
			var flag;
			var domain_choice	=  $('#domain_selected').val();
			//alert(domain_choice);
			flag	=	check_form_domain();
			if(flag != false)
			{
				var query_string;
				var merchant		=	$('#merchant').val();
				var pid			=	$('#pid').val();
				var domainval		=	$('#domain').val();
				var email		=	$('#email').val();
				var sitetitle		=	$('#sitetitle').val();
				var uniqueblog		=	$('#uniqueblog:checked').val();
				var Create_Domain	=	$('#Create_Domain').val();
				query_string		=	"pid="+pid+"&domain="+domainval+"&email="+email+"&sitetitle="+sitetitle+"&uniqueblog="+uniqueblog+"&merchant="+merchant+"&Create_Domain="+Create_Domain;
				//alert(query_string);	
				httpObject.open("GET", "sitebuilder_step3.php?"+query_string);
				httpObject.send(null);
				httpObject.onreadystatechange = showDomainStep3;
			}
		
		}
	
	}
	
	// Used for sitebuilderstep2
	function showDomainStep3()
	{
		 document.getElementById("displayname").style.display="block";
		if(httpObject.readyState == 4)
		{
			$('#divright').hide();
			$('#step1_id').hide();
			$('#step2_id').hide();
			document.getElementById("step3_id").innerHTML	=	httpObject.responseText;
			imagePreview();
		}
	}

	//To Get SiteBuilder Step2
      	function validateSubDomain()
	{
		httpObject = getHTTPObject();
		
		if (httpObject != null) 
		{
			var flag;
			var domain_choice	=  $('#domain_selected').val();
			//alert(domain_choice);
			flag	=	check_form_subdomain();
			if(flag != false)
			{
				var query_string;
				var merchant		=	$('#merchant').val();
				var pid			=	$('#pid').val();
				var domainval		=	$('#subdomain').val();
				var email		=	$('#email').val();
				var sitetitle		=	$('#sitetitle').val();
				var uniqueblog		=	$('#uniqueblog:checked').val();
				var Create_subDomain	=	$('#Create_subDomain').val();
				query_string		=	"pid="+pid+"&subdomain="+domainval+"&email="+email+"&sitetitle="+sitetitle+"&uniqueblog="+uniqueblog+"&merchant="+merchant+"&Create_subDomain="+Create_subDomain;
				//alert(query_string);	
				httpObject.open("GET", "sitebuilder_step3.php?"+query_string);
				httpObject.send(null);
				httpObject.onreadystatechange = showSubDomainStep3;
			}
		
		}
	
	}
	
	// Used for sitebuilderstep2
	function showSubDomainStep3()
	{
		//alert(httpObject.readyState );
		document.getElementById("displayname").style.display="block";
		if(httpObject.readyState == 4)
		{
			$('#divright').hide();
			//$('#step1_id').hide();
			//$('#step2_id').hide();
			document.getElementById("step1_id").style.display = "none";
			document.getElementById("step2_id").style.display = "none";
			document.getElementById("step3_id").innerHTML	=	 httpObject.responseText;
			imagePreview();
		}
	}

	//To Get SiteBuilder Step3
      	function showThankYou()
	{
		httpObject = getHTTPObject();
		
		if (httpObject != null) 
		{
			var flag;
			var domain_choice	=  $('#domain_selected').val();
			loading();
			//alert(domain_choice);
			//flag	=	check_form_subdomain();
			//if(flag != false)
			//{
				var query_string;
				var username			=	$('#username').val();
				var sitepassword		=	$('#sitepassword').val();
				var dbname			=	$('#dbname').val();
				var pid				=	$('#pid').val();
				var domainval			=	$('#domain').val();
				var merchant			=	$('#merchant').val();
				var theamselcted		= 	$("input[name='theamselcted']:checked").val();
				var Create_Domain		=	$('#Create_Domain').val();
				
				query_string			=	"pid="+pid+"&domain="+domainval+"&merchant="+merchant+"&dbname="+dbname+"&username="+username+"&sitepassword="+sitepassword+"&theamselcted="+theamselcted+"&Create_Domain="+Create_Domain;
				//alert(query_string);	
				httpObject.open("GET", "thankyou.php?"+query_string);
				httpObject.send(null);
				httpObject.onreadystatechange = showThankYouStep4;
			//}
		
		}
	
	}
	
	// Used for sitebuilderstep2
	function showThankYouStep4()
	{
		document.getElementById("displayname").style.display="block";
		if(httpObject.readyState == 4)
		{
			$('#divright').hide();
			$('#step1_id').hide();
			$('#step2_id').hide();
			$('#step3_id').hide();
			document.getElementById("step4_id").innerHTML	=	 httpObject.responseText;
		}
	}
	
	