function to_see(tab,d) 
{
	i=1;
	
	while (document.getElementById("tab_"+i))
	 {
	 document.getElementById("tab_"+i).style.display='none';
	 document.getElementById('d'+i).className='free_quote_tab'
	 i++;
	 
	 }
	 document.getElementById(tab).style.display='block';
	 document.getElementById(d).className='sel_free_quote_tab'
}
function form(tab,cls) 
{
	i=1;
	
	while (document.getElementById("tab_"+i))
	 {
	 document.getElementById("tab_"+i).style.display='none';
	 document.getElementById("a"+i).className='';
	 i++;
	 
	 }
	 document.getElementById(tab).style.display='block';
	 document.getElementById(cls).className='sel';
}


function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} 
function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}


function change(id,cl) {
	i=1;
	while (document.getElementById("t"+i))
	 {
	 document.getElementById("t"+i).style.display='none';
	 document.getElementById("b"+i).className='';
	 i++;	 
	 }
	 document.getElementById(id).style.display='block';
	 document.getElementById(cl).className='sel';
	}

function check_f4(){
var thefrm;
thefrm = document.forms['f4'];
if (!check_not_empty4(thefrm.e35, 'First Name cannot be empty!')) return false;
if (!check_not_empty4(thefrm.e36, 'Last Name cannot be empty!')) return false;
if (!check_email_address4(thefrm.e37, 'Email Address must be an email address!')) return false;
if (!check_not_empty4(thefrm.e39, 'Primary Phone cannot be empty!')) return false;
return true;
}
function check_select4(theControl, theMessage){
var selValue;
var i;
selValue = '';
for (i=0;i<theControl.length;i++)
if (theControl[i].selected)
selValue += theControl[i].value;
if (selValue==''){
theControl.focus();
alert(theMessage);
return false;}
return true;
}
function check_not_empty4(theControl, theMessage){
if (theControl.value==''){
theControl.focus();
alert(theMessage);
return false;}
return true;
}
function check_number4(theControl, theMessage){
if (!check_not_empty4(theControl, theMessage)) return false;
if (isNaN(Number(theControl.value))){
theControl.focus();
alert(theMessage);
return false;}
return true;
}
function check_checkbox4(theControl, theMessage){
if (!theControl.checked){
theControl.focus();
alert(theMessage);
return false;}
return true;
}
function check_file4(theControl, theMessage){
if (theControl.value==''){
theControl.focus();
alert(theMessage);
return false;}
return true;
}
function check_email_address4(theControl, theMessage){
if (window.RegExp) {
var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
var reg1 = new RegExp(reg1str);
var reg2 = new RegExp(reg2str);
if (!reg1.test(theControl.value) && reg2.test(theControl.value)) return true;
theControl.focus();
alert(theMessage);
return false;
} else {
if(str.indexOf("@") >= 0) return true;
theControl.focus();
alert(theMessage);
return false;
}
}