function getQuote(id){
	document.getElementById(id).style.display='block';
	window.scrollBy(0,-10000);
	document.body.style.overflow='hidden';
}
function closeQuote(id){
	document.getElementById(id).style.display='none';
	document.body.style.overflow='auto';
}
	var moveby = 0;
	var pic;
function nextStep(id){
	moveby = moveby + 802;
	document.getElementById(id).style.left=-moveby+'px';
	switch (moveby){
	case 802: 
	  pic = 2;
	  break;
	case 1604: 
	  pic = 3;
	  break;
	case 2406: 
	  pic = 4;
	  break;
	default: 
	  pic = 1;
	}
	document.getElementById('web-design-quote-top').style.backgroundImage='url(clients/templates/tsghosting/images/custom-web-design-quote-step'+pic+'.png)';
}
function prevStep(id){
	moveby = moveby - 802;
	document.getElementById(id).style.left=-moveby+'px';
	switch (moveby){
	case 802: 
	  pic = 2;
	  break;
	case 1604: 
	  pic = 3;
	  break;
	case 2406: 
	  pic = 4;
	  break;
	default: 
	  pic = 1;
	}
	document.getElementById('web-design-quote-top').style.backgroundImage='url(clients/templates/tsghosting/images/custom-web-design-quote-step'+pic+'.png)';
}
function backButtonOver(id){
	document.getElementById(id).src='clients/templates/tsghosting/images/web-quote-goback-over.png';
}
function backButtonOut(id){
	document.getElementById(id).src='clients/templates/tsghosting/images/web-quote-goback.png';
}
	var eCommerce = '';
	var CMSsystem = '';
	var websiteDesign = '';
	var socialMarketing = '';
	var webProgramming = '';
	var videoMarketing = '';
	var flashAnimation = '';
	var bannerDesign = '';
	var graphicDesign = '';
	var PPCcpaMarketing = '';
	var seoServices = '';
	var facebookApps = '';
	var other = '';
	var timeLine = '';
	var projectDetails = '';
	var specialNeeds = '';
	var name = '';
	var title = '';
	var company = '';
	var email = '';
	var address = '';
	var city = '';
	var State = '';
	var Zip = '';
	var phoneNumber = '';
	
function checkForm(){
	if (document.webDesignQuote.eCommerce.checked == true){
	eCommerce = encodeURIComponent('\teCommerce\n');
	} else{
	}
	if (document.webDesignQuote.CMSsystem.checked == true){
	CMSsystem = encodeURIComponent('\tCMS System\n');
	} else{
	}
	if (document.webDesignQuote.websiteDesign.checked == true){
	websiteDesign = encodeURIComponent('\tWebsite Design\n');
	} else{
	}
	if (document.webDesignQuote.socialMarketing.checked == true){
	socialMarketing = encodeURIComponent('\tSocial Marketing\n');
	} else{
	}
	if (document.webDesignQuote.webProgramming.checked == true){
	webProgramming = encodeURIComponent('\tWeb Programming\n');
	} else{
	}
	if (document.webDesignQuote.videoMarketing.checked == true){
	videoMarketing = encodeURIComponent('\tVideo Marketing\n');
	} else{
	}
	if (document.webDesignQuote.flashAnimation.checked == true){
	flashAnimation = encodeURIComponent('\tFlash Animation\n');
	} else{
	}
	if (document.webDesignQuote.bannerDesign.checked == true){
	bannerDesign = encodeURIComponent('\tBanner Design\n');
	} else{
	}
	if (document.webDesignQuote.graphicDesign.checked == true){
	graphicDesign = encodeURIComponent('\tGraphic Design\n');
	} else{
	}
	if (document.webDesignQuote.PPCcpaMarketing.checked == true){
	PPCcpaMarketing = encodeURIComponent('\tPPC/CPA Marketing\n');
	} else{
	}
	if (document.webDesignQuote.seoServices.checked == true){
	seoServices = encodeURIComponent('\tSEO Services\n');
	} else{
	}
	if (document.webDesignQuote.facebookApps.checked == true){
	facebookApps = encodeURIComponent('\tFacebook Apps\n');
	} else{
	}
	if (document.webDesignQuote.other.value){
	other = encodeURIComponent('\tOther: '+document.webDesignQuote.other.value+'\n');
	} else{
	}

	for (var i=0; i < document.webDesignQuote.projectTimeline.length; i++)
	   {
	   if (document.webDesignQuote.projectTimeline[i].checked)
		  {
		  timeLine = encodeURIComponent(document.webDesignQuote.projectTimeline[i].value);
		  }
	   }
	
	if (document.webDesignQuote.projectDetails.value){
	projectDetails = encodeURIComponent(document.webDesignQuote.projectDetails.value);
	}
	if (document.webDesignQuote.specialNeeds.value){
	specialNeeds = encodeURIComponent(document.webDesignQuote.specialNeeds.value);
	}
	if (document.webDesignQuote.name.value){
	name = encodeURIComponent(document.webDesignQuote.name.value);
	}
	if (document.webDesignQuote.title.value){
	title = encodeURIComponent(document.webDesignQuote.title.value);
	}
	if (document.webDesignQuote.company.value){
	company = encodeURIComponent(document.webDesignQuote.company.value);
	}
	if (document.webDesignQuote.email.value){
	email = encodeURIComponent(document.webDesignQuote.email.value);
	}
	if (document.webDesignQuote.address.value){
	address = encodeURIComponent(document.webDesignQuote.address.value);
	}
	if (document.webDesignQuote.city.value){
	city = encodeURIComponent(document.webDesignQuote.city.value);
	}
	if (document.webDesignQuote.State.value){
	State = encodeURIComponent(document.webDesignQuote.State.value);
	}
	if (document.webDesignQuote.Zip.value){
	Zip = encodeURIComponent(document.webDesignQuote.Zip.value);
	}
	if (document.webDesignQuote.phoneNumber.value){
	phoneNumber = encodeURIComponent(document.webDesignQuote.phoneNumber.value);
	}
	insertQuote()
}
function insertQuote(){
	var nocache = 0;
	nocache = Math.random();
	
	
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
		document.getElementById("moveQuote").style.width=300+'px';
		document.getElementById("moveQuote").style.left=0+'px';
		document.getElementById("thankYou").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("POST","clients/templates/tsghosting/includes/submit-quote.php",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("eCommerce="+eCommerce+"&CMSsystem="+CMSsystem+"&websiteDesign="+websiteDesign+"&socialMarketing="+socialMarketing+"&webProgramming="+webProgramming+"&videoMarketing="+videoMarketing+"&flashAnimation="+flashAnimation+"&bannerDesign="+bannerDesign+"&graphicDesign="+graphicDesign+"&PPCcpaMarketing="+PPCcpaMarketing+"&seoServices="+seoServices+"&facebookApps="+facebookApps+"&other="+other+"&timeLine="+timeLine+"&projectDetails="+projectDetails+"&specialNeeds="+specialNeeds+"&name="+name+"&title="+title+"&company="+company+"&email="+email+"&address="+address+"&city="+city+"&State="+State+"&Zip="+Zip+"&phoneNumber="+phoneNumber+"&nocache="+nocache);
}
function KeyCheck(){
	document.onkeydown = TabCheck;
}
function TabOff(){
	document.onkeydown = null;
}
function TabCheck(e){
		var tab = (window.event) ? event.keyCode : e.keyCode;
		if(tab == 9 && moveby != 2406){
			nextStep('moveQuote');
		}
}
function nextFocus(id){
	document.getElementById(id).focus();
}
function prevFocus(id){
	document.getElementById(id).focus();
}
