// validate search
function validateSearch(){
	if(document.search.srchField.value == ""){
		alert("Please enter a word or sentence to search for");
		document.search.srchField.focus();
		return false
	} else
	if(document.search.srchField.value.length<=2 ){
		alert("Please enter a valid word of more than 2 characters");
		document.search.srchField.focus();
		return false
		} else
	if(document.search.srchField.value == "enter a keyword" ){
		alert("Please enter a search term other than 'enter a keyword'");
		document.search.srchField.focus();
		return false
	} else {
		return true
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizable=no,status=yes'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function NewWindow2(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=yes,status=yes'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function email(ahost,auser) {
	window.document.location.href = "mailto:"+auser+"@"+ahost;
}

function email2(ahost,auser,asubject) {
	window.document.location.href = "mailto:"+auser+"@"+ahost+"?subject="+asubject;
}

// for validating adding a blog
function validateAddBlog(){
	if(document.blogadd.heading.value == ""){
		alert("Please enter a heading for your post");
		document.blogadd.heading.focus();
		return false
	}else
	if(document.blogadd.content.value == ""){
		alert("Please enter some content into your blog post");
		document.blogadd.content.focus();
		return false
	}else{
		return true
	}
}
// for validating adding a blog

// for images in blog admin
function showhide(layerID, mode) {
	var currentRef = document.getElementById(layerID).style

	//Display modes 1 for on 0 for off
	modes = new Array
	modes[0] = 'none'
	modes[1] = 'block'

	if(isNaN(mode))
	currentRef.display = (currentRef.display == 'none') ? 'block' : 'none'
	else
	currentRef.display = modes[mode]
}
// for image in blog admin

function validate(){
	if(document.comment.name.value == ""){
		alert("Please enter your name");
		document.comment.name.focus();
		return false
	} else
	if(document.comment.name.value == "online video poker game" || 
	document.comment.name.value == "play texas holdem" || 
	document.comment.name.value == "3 card poker" || 
	document.comment.name.value == "how to play poker" || 
	document.comment.name.value == "pacific poker" || 
	document.comment.name.value == "slot machines" || 
	document.comment.name.value == "texas holdem" || 
	document.comment.name.value == "poker rules" || 
	document.comment.name.value == "texas holdem online free" || 
	document.comment.name.value == "poker" || 
	document.comment.name.value == "poker games" || 
	document.comment.name.value == "online poker" || 
	document.comment.name.value == "roulette" || 
	document.comment.name.value == "online casinos" || 
	document.comment.name.value == "online casino gambling" || 
	document.comment.name.value == "home loans" || 
	document.comment.name.value == "party poker scanner" || 
	document.comment.name.value == "texas holdem poker rule" || 
	document.comment.name.value == "free online texas holdem game" || 
	document.comment.name.value == "live free strip poker" || 
	document.comment.name.value == "free online video poker game" || 
	document.comment.name.value == "free online poker game texas holdem" || 
	document.comment.name.value == "pacific poker bonus code" || 
	document.comment.name.value == "strongest prescription diet pills available" || 
	document.comment.name.value == "cheap diet pills obesity" || 
	document.comment.name.value == "law suits against party poker on line" || 
	document.comment.name.value == "play party poker" || 
	document.comment.name.value == "TEXAS HOLDEM CARD SETS" || 
	document.comment.name.value == "None" || 
	document.comment.name.value == "online poker ratings calculator" || 
	document.comment.name.value == "stratagies for texas holdem poker online signup codes" || 
	document.comment.name.value == "canadian online poker messageboards" || 
	document.comment.name.value == "poker online Room message boards" || 
	document.comment.name.value == "what is the best diet pill" || 
	document.comment.name.value == "discover card" || 
	document.comment.name.value == "discount phentermine" || 
	document.comment.name.value == "Texas Holdem Help" || 
	document.comment.name.value == "Free Online Texas Holdem" ||
	document.comment.name.value == "Texas Holdem Software" || 
	document.comment.name.value == "games" || 
	document.comment.name.value == "casino" || 
	document.comment.name.value == "enjoy Party Poker bonus" || 
	document.comment.name.value == "bonus" || 
	document.comment.name.value == "tournament" || 
	document.comment.name.value == "gambling" || 
	document.comment.name.value == "companion roulette software" || 
	document.comment.name.value == "foreign online pharmacy review" || 
	document.comment.name.value == "review" || 
	document.comment.name.value == "get veterinary pharmacy" || 
	document.comment.name.value == "celexa discount pharmacy purchase pills" || 
	document.comment.name.value == "pill" || 
	document.comment.name.value == "doctors who will write prescriptions online oxycodone pills" || 
	document.comment.name.value == "prescription" || 
	document.comment.name.value == "buy online pharmacy forums" || 
	document.comment.name.value == "phatmacy" || 
	document.comment.name.value == "cheap diet pill prescription web site" || 
	document.comment.name.value == "top rated liquid diet pills" || 
	document.comment.name.value == "las vegas slot machines message board" || 
	document.comment.name.value == "free play sims slot reviews" || 
	document.comment.name.value == "credit card application" || 
	document.comment.name.value == "win"){
		 window.location="http://www.googleityoumoron.com/?act=asshole";
		 return false;
	} else
	if(document.comment.title.value == "the best u are" || 
		document.comment.title.value == "strategy guide law suits against party poker" || 
		document.comment.title.value == "play party poker" || 
		document.comment.title.value == "TEXAS HOLDEM CARD SETS freeroll" || 
		document.comment.title.value == "None" ||
		document.comment.title.value == "online poker ratings" || 
		document.comment.title.value == "stratagies for texas holdem poker online software" || 
		document.comment.title.value == "canadian online poker programs" || 
		document.comment.title.value == "poker online Room statistics" || 
		document.comment.title.value == "what is the best diet pill" || 
		document.comment.title.value == "discover card" || 
		document.comment.title.value == "home loans" || 
		document.comment.title.value == "discount phentermine" || 
		document.comment.title.value == "Texas Holdem Help" || 
		document.comment.title.value == "Free Online Texas Holdem" ||
		document.comment.title.value == "Texas Holdem Software" || 
		document.comment.title.value == "play texas holdem online reload bonuses" || 
		document.comment.title.value == "gambling" || 
		document.comment.title.value == "net Party Poker bonus" || 
		document.comment.title.value == "companion black jack online pay pal" || 
		document.comment.title.value == "tournament" || 
		document.comment.title.value == "win" || 
		document.comment.title.value == "games" || 
		document.comment.title.value == "credit card application" || 
		document.comment.title.value == "las vegas slot machines bonuses" || 
		document.comment.title.value == "danger of diet pill web site" || 
		document.comment.title.value == "enjoy liquid diet pills" || 
		document.comment.title.value == "get cheap diet pill prescription" || 
		document.comment.title.value == "price" || 
		document.comment.title.value == "pill" || 
		document.comment.title.value == "canadian pharmacy online directory site" || 
		document.comment.title.value == "prescription" || 
		document.comment.title.value == "online pharmacies no prescription needed sites" || 
		document.comment.title.value == "store" || 
		document.comment.title.value == "phatmacy"){
		 window.location="http://www.googleityoumoron.com/?act=asshole";
		 return false;
	} else
	if(document.comment.name.value.length<=1 ){
		alert("Please enter a valid name of more than 1 character");
		document.comment.name.focus();
		return false
	} else 
	if(document.comment.comment.value == "" ){
  	alert("Please enter a comment");
		document.comment.comment.focus();
		return false
	}  else 
	if(document.comment.verif_box.value == "" ){
  	alert("Please enter the verification code");
		document.comment.verif_box.focus();
		return false
	} else {
		return true
	}
}
// submit vote form
function submitVote() {
	document.frmVote.submit()
}
// submit gallery comment
function submitGComment() {
  document.frmGComment.submit();
}