function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target="_blank"; 
 } 
} 
window.onload = externalLinks;

function clearForm(val,defaultval){
	if(val.value==defaultval){
		val.value="";
	}
}

$(document).ready(function() {	
		$("#newsletterForm").validate();	
		$("#quoteForm").validate();
		$("#referForm2").validate();
		$("#retrieveQuoteForm").validate();
		$(".tab_item a.grey_icon").click(function () {
			$(".tab_item a.grey_icon").removeClass("active");
			$(".tab_item a.grey_icon_2_lines").removeClass("active");
			$(this).toggleClass("active");
			$rel = $(this).attr("rel");
			$(".tab").hide();
			$($rel).show();
			return false;
		});
		$(".tab_item a.grey_icon_2_lines").click(function () {
			$(".tab_item a.grey_icon").removeClass("active");
			$(".tab_item a.grey_icon_2_lines").removeClass("active");
			$(this).toggleClass("active");
			$rel = $(this).attr("rel");
			$(".tab").hide();
			$($rel).show();
			return false;
		});
		$(".tab_item a.tab_icon").click(function () {
			$(".tab_item a.grey_icon").removeClass("active");
			$(".tab_item a.grey_icon_2_lines").removeClass("active");
			$(this).next(".grey_icon").toggleClass("active");
			$(this).next(".grey_icon_2_lines").toggleClass("active");
			$rel = $(this).attr("rel");
			$(".tab").hide();
			$($rel).show();
			return false;
		});
});
