function searchLimit(site){
	$("#weblog").val(site);	
	$("#network").attr("checked","");
	$("#network").click(
		function (){
				if (this.checked == true) {
					$("#weblog").val("gardenaut|poly|prizey|punny|tranq|zrec|zrecs-guide");
				}
				else {
					$("#weblog").val(site);
				}
		}
	)
}

function checkComment() {
	if (checkemail($("input#email").val()))
	 	return true;
	else {
		
		$("input#email").prev().css("color","red");
	   	alert("You must enter a valid email address to post a comment");
	}
	return false;
}


function checkemail(str){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str))
		testresults=true
	else{
		testresults=false
	}
	return (testresults)
}

		   

$(document).ready(function(){
    $('.prizey-select').selectbox();  
    $('.change-select').selectbox();  	
    $("#left-accordion").accordion({active: false, header: "a.head", autoHeight: false, alwaysOpen: false});
    $("#left-accordion").accordion("activate", -1);
	$("#right-accordion").accordion({active: false, header: "a.head", autoHeight: false, alwaysOpen: false});	
	$("input.newlinks").click(
		function (){
				if (this.checked == true) {	
					$(".related-links a").attr("target","_blank");
					$("body#zrecs-guide .zrec-post a").attr("target","_blank");
					$("input.newlinks").attr("checked","checked");
				}
				else {
					$(".related-links a").removeAttr("target");					
					$("body#zrecs-guide .zrec-post a").removeAttr("target");
					$("input.newlinks").each(function () { this.checked = false; });
				}
		}
	)	
  });

