
function unblur() {
	this.blur();
} 
function blurLinks() {
	if (!document.getElementById) return;
	theLinks = document.getElementsByTagName("A");
	theAreas = document.getElementsByTagName("AREA");
	for(i=0; i<theLinks.length; i++) {theLinks[i].onfocus = unblur;}
	for(i=0; i<theAreas.length; i++) {theAreas[i].onfocus = unblur;}
  } 

$('.answer').hide();	

$(document).ready(function() { 

$('#sidebarcall').click(function(){
$(this).hide();
$('#sidebar1').animate({"width":"500px", "height":"1000px",  "padding":"12px", "margin-top":"-280px" }, 400);
 });

$('.close').click(function(){
$('#sidebar1').animate({"width":"0px", "height":"0px", "padding":"0px" }, 400);
$('#sidebarcall').fadeIn('400');
 });

$('.EFP').hide();
$('.PFP').hide();
$('.PFF').hide();
$('.RFP').hide();



$('label.error').hide();
		
			$('.clickme').click(function(){
			$('html, body').animate({scrollTop:0}, 'slow');
				});
		
  $("ul.sf-menu").supersubs({ 
            minWidth:    1,   // minimum width of sub-menus in em units 
            maxWidth:    27,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish();  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason. 


$('#submitDUMPTHIS').click(function() {
$("#infoDUMPTHIS").validate({ 	
					
	rules:{
		"InterestedIn[]": "required",
		name: "required",
		phone: {
			required: true,
			minlength: 10
		},
		email: {
		required: true,
		email: true
		}
		
		
	},
	messages:{
		name: "Your Name is Required",
		phone:{ 
		required: "Your phone number is required",
		minlength: "Please use your entire phone number"
		},
		email: "Please enter a valid email address"
		
	},
	
	
submitHandler: function(form) {

	
//   	$(form).ajaxSubmit();
  
var name = $("input#name").val();	
var email = $("input#email").val();
var phone = $("input#phone").val();
var prefercontact = $("input#prefercontact").val();
var comment = $("textarea#comment").val();
			
		var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone + '&prefercontact=' + prefercontact + '&comment=' + comment;
		//alert (dataString);return false;		  
     
	$.ajax({
      type: "POST",
      url: "sendscript.php",
      data: dataString,
      success: function() {
        $('#contact_form').html("<div id='message'></div>");
        $('#message').html("<h2>Contact Form Submitted!</h2>")
        .append("<p>We will be in touch soon.</p>")
        .hide()
        .fadeIn(500, function() {
          $('#message').append("");
        });
      } 
     });  
  
  
  
  }


});
// return false;	 
//  $('#info').submit();
});
 
		
$('.linkEFP').click(function(){

$('.PFP').hide();
$('.PFF').hide();
$('.EFP').show();
});

$('.linkPFP').click(function(){
$('.EFP').hide();
$('.PFF').hide();
$('.PFP').show();
});

$('.linkPFF').click(function(){
$('.EFP').hide();

$('.PFP').hide();$('.PFF').show();
});


if($.browser.msie && $.browser.version == '7.0') {$(".answer").show();$(".expand").hide();
}else{
$('.answer').hide();	
	// show them
$(".question").click(function(){
$(".answer").slideUp('400')
$(".question").toggleClass('red', false)
$(".question:after").toggleClass('red', false)
$(this).toggleClass('red')

	if($.browser.msie && $.browser.version == '8.0') {$(this).next(".answer").show();
} else { $(this).next(".answer").slideDown('400');}
//$(this).next(".answer").slideDown('400')
$(this).next(".answer").focus()
return true;

});
  }
  
  

if($.browser.msie && $.browser.version == '7.0') {
	$(".answer2").show();$(".expand").hide();
}else{
$('.answer2').hide();	
	// show them
$(".question2").click(function(){
$(".answer2").slideUp('400')
$(".question2").toggleClass('red', false)
$(".question2:after").toggleClass('red', false)
$(this).toggleClass('red')

	if($.browser.msie && $.browser.version == '8.0') {$(this).next(".answer2").show();
} else { $(this).next(".answer2").slideDown('400');}
//$(this).next(".answer").slideDown('400')
$(this).next(".answer2").focus()
return true;

});
  }
  
// players

if($.browser.msie && $.browser.version == '7.0') {
	$(".answer").show();$(".expand").hide();
}else{
$('.answer').hide();	
	// show them
$(".player").click(function(){
$(".answer").slideUp('400')


//$(".expand").hide()
//$(this).next(".expand").show()
$(".player").toggleClass('answered', false)
$(".player:after").toggleClass('answered', false)
$(this).toggleClass('answered')

	if($.browser.msie && $.browser.version == '8.0') {$(this).next(".answer").show();
} else { $(this).next(".answer").slideDown('400');}
//$(this).next(".answer").slideDown('400')
$(this).next(".answer").focus()
return true;

});
  } 
  
  
$('.cracklink').click(function(){ //alert();
$(".answer2").hide();  
$('html, body').animate({     scrollTop: $("#cracking").offset().top}, 400); 

$("#cracking").delay(600).queue(function(){ 
  $(this).trigger("click"); 
  $(this).dequeue(); 
});
 });

$('#toneholelink').click(function(){ //alert();
window.location = "/faqs.php#tonehole";
/*$('html, body').load("/faqs.php", function () {
$(".answer2").hide();   
$('html, body').animate({     scrollTop: $("#tonehole").offset().top}, 400); 
$("#tonehole").delay(100).queue(function(){ 
  $(this).trigger("click"); 
  $(this).dequeue(); 
										 });
});*/
 });


  
}); //end JQ
	

function eMails($a, $b, $c) {
var static=String.fromCharCode(109,97,105,108,116,111,58);
document.write("<a href=\"");
document.write(static);
document.write($a);
document.write(String.fromCharCode(64));
document.write($b);
document.write("\">");
document.write($c);
document.write("</a>");
	
}
