	
	// name pass
		$(document).ready(function() {
			$('.GrayToBlack').addClass("idleField");
    		$('.GrayToBlack').focus(function() {
    			$(this).removeClass().addClass("focusField");
 		    if (this.value == this.defaultValue){ 
 		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
 		});
 		$('.GrayToBlack').blur(function() { 
 		    if ($.trim(this.value) == ''){
			    	this.value = (this.defaultValue ? this.defaultValue : '');
					$(this).removeClass().addClass("idleField");
				}
 		});
		});	
		
		var slide=1;	
		
		// slideshow
		function slideshow() {
			
			slide+=1; 
			if (slide>=10) { slide=1; }			
		
			window.setTimeout(function() {
        	$('#header_image'+slide).fadeIn("slow");
			}, 500);
			
			window.setTimeout(function() {
			if (slide==1) {
        	$('#header_image9').hide(); } else {
        	$('#header_image'+(slide-1)).hide(); }
			}, 1500);
			
			
			window.setTimeout(function() {
			slideshow();
			}, 2500);
			
			
		}
				
				
				
		//start slideshow
			window.setTimeout(function() {
			slideshow();
			}, 2500);
 
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-11112949-3']);
  _gaq.push(['_trackPageview']);
 
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  

  $(document).ready(function() {
  	
  	$("#savelead").click(function() {
  		  $("#frm2").submit();
  		});
  	
  	var validator = $("#frm2").validate({
  		rules: {
  			business: {
  				required: true
  			},
  			contact: {
  				required: true
  			},
  			email: {
  				required: true,
				email: true
  			},
  			tbusiness: {
  				required: true
  			},
  			phone: {
  				required: true
  			},
  			address: {
  				required: true
  			},
  			rtbusiness: {
  				required: true
  			},
  			note: {
  				required: true
  			}				
  		}
  	});

  	$('#lid').alphanumeric({ichars:"'\"&\\/"});
  	$('#business').alphanumeric({ichars:"\"&\\/"});
  	$('#contact').alphanumeric({ichars:"\"&\\/"});
  	$('#tbusiness').alphanumeric({ichars:"'\"&\\/"});
  	$('#phone').alphanumeric({ichars:"\"&\\/"});
  	$('#address').alphanumeric({ichars:"\"&\\/"});
  	$('#rtbusiness').alphanumeric({ichars:"\"&\\/"});
  	$('#email').alphanumeric({ichars:"\"&\\/"});
  	$('#note').alphanumeric({ichars:"\"&\\/"});	
  });
  
  
  
  
  $(document).ready(function() {
  	
  	$("#save_account").click(function() {
  		  $("#frm4").submit();
  		});
  	
 	$("#pweb").click(function() {
		  $("#iweb").submit();
		});
  	
  	var validator = $("#frm4").validate({
  		rules: {
  			fname: {
  				required: true
  			},
  			sname: {
  				required: true
  			},
  			street_address: {
  				required: true
  			},
  			suite_number: {
  				required: true
  			},
  			city_state_zip: {
  				required: true
  			},
  			phone: {
  				required: true
  			},
  			fax: {
  				required: true
  			},
  			web: {
  				required: true
  			},
  			email: {
  				required: true,
				email: true
  			}				
  		}
  	});

  	$('#fname').alphanumeric({ichars:"'\"&\\/"});
  	$('#sname').alphanumeric({ichars:"\"&\\/"});
  	$('#street_address').alphanumeric({ichars:"\"&\\/"});
  	$('#suite_number').numeric({ichars:"'\"&\\/"});
  	$('#city_state_zip').alphanumeric({ichars:"\"&\\/"});
  	$('#phone').alphanumeric({ichars:"\"&\\/"});
  	$('#fax').alphanumeric({ichars:"\"&\\/"});
  	$('#web').alphanumeric({ichars:"\"&\\/"});
  	$('#email').alphanumeric({ichars:"\"&\\/"});	
  });

  function loadLead(str){	
  	var vlist = str.split("|");
  	document.getElementById('lid').value = vlist[0];
  	document.getElementById('business').value = vlist[1];
  	document.getElementById('contact').value = vlist[2];
  	document.getElementById('tbusiness').value = vlist[3];
  	document.getElementById('phone').value = vlist[4];
  	document.getElementById('address').value = vlist[5];
  	document.getElementById('email').value = vlist[6];	
  	document.getElementById('rtbusiness').value = vlist[7];				
  	document.getElementById('note').value = vlist[8];			
  }
