

 browserName = navigator.appName;
   browserVer = parseInt(navigator.appVersion);
   if ( (browserName == "Netscape" && browserVer >= 3) ||
   (browserName == "Microsoft Internet Explorer" && browserVer >= 4)) compat = "true";
   else compat = "false";

   function jumpBox(list) {
            if (compat == "true") {
              location.href = list.options[list.selectedIndex].value;
           }
   }

   function back() {
        if (compat == "true") {
        history.go(-1)
        }
   }

   function valid_url(form) {
    var site_tag = form.sitetitle.value;
    var name_tag = form.custom_field_1.value;
    var description_tag = form.sitedescription.value;
    var cat_tag = form.category_wanted.value;
    var file_tag = form.add_site.value;


	if (!site_tag)
	{
	 alert("You must type in a title.");
	 return false;
	}
	if (!name_tag)
	{
	 alert("You must type in a name.");
	 return false;
	}
	if (!description_tag)
	{
	 alert("Please fill in a description.");
	 return false;
	}
	if (cat_tag == 0)
	{
	 alert("You forgot to pick category.");
	 return false;
	}
	 if (!file_tag)
	{
	alert("You forgot to add a link to your snippet.");
	 return false;
	}


return true;
}

function valid_turl(form) {
    var site_tag = form.tname.value;
    var description_tag = form.sitedescription.value;
    var file_tag = form.turl.value;
     var cat_tag = form.category_wanted.value;

	if (!site_tag)
	{
	 alert("You must type in a title.");
	 return false;
	}

	if (!description_tag)
	{
	 alert("Please fill in a description.");
	 return false;
	}
	if (cat_tag == 0)
	{
	 alert("You forgot to pick category.");
	 return false;
	}
	 if (!file_tag)
	{
	alert("You forgot to add a link to your snippet.");
	 return false;
	}


return true;
}

   function valid_file(form) {
    var title_tag = form.sitetitle.value;
    var name_tag = form.custom_field_1.value;
    var des_tag = form.sitedescription.value;
    var cat_tag = form.category_wanted.value;

	if (!title_tag)
	{
	 alert("You must type in a title.");
	 return false;
	}
	if (!name_tag)
	{
	 alert("You must type in a name.");
	 return false;
	}
	if (!des_tag)
	{
	 alert("Please fill in a description.");
	 return false;
	}
	if (cat_tag == 0)
	{
	alert("You forgot to pick category.");
	 return false;
	}


return true;
}

function valid(form) {
  var title_tag = form.sitetitle.value;
  var sitedescription_tag = form.sitedescription.value;
	var sitecatid_tag = form.category_wanted.value;
	var customfield2_tag = form.custom_field_6.value;
	var customfield1_tag = form.custom_field_1.value;
	var headfield_tag = form.custom_field_4.value;
	var bodyfield_tag = form.custom_field_5.value;

	if (!title_tag)
	{
   alert("You must type in a title.");
	 return false;
	}
	if (!sitedescription_tag)
	{
	 alert("Please fill in a description.");
	 return false;
	}
	if (sitecatid_tag == 0)
	{
	 alert("You must choose a category to add you snippet into.");
	 return false;
	}
	if (customfield2_tag == 0)
	{
	 alert("If you do not know what version, then type 'unknown' or 'all'.");
	 return false;
	}
	if (customfield1_tag == 0)
	{
	 alert("You must type in a name in Snippet by: If you do not know, then type 'unknown'.");
	 return false;
	}
	if (!headfield_tag)
	{
	 alert("You must type in the Head field, if there is nothing type 'none'.");
	 return false;
	}
	if (!bodyfield_tag)
	{
	 alert("You must type in the snippet in the body box.");
	 return false;
	}
return true;
}

function validvb(form) {
  var title_tag = form.sitetitle.value;
  var sitedescription_tag = form.sitedescription.value;
	var sitecatid_tag = form.category_wanted.value;
	var customfield2_tag = form.custom_field_6.value;
	var customfield1_tag = form.custom_field_1.value;
	var declarations_tag = form.custom_field_2.value;
	var code_tag = form.custom_field_3.value;

	if (!title_tag)
	{
	alert("You must type in a title.");
	 return false;
	}
	if (!sitedescription_tag)
	{
	 alert("Please fill in a description.");
	 return false;
	}
	if (sitecatid_tag == 0)
	{
	 alert("You must choose a category to add you snippet into.");
	 return false;
	}
	if (customfield2_tag == 0)
	{
	 alert("If you do not know what version, then type 'unknown' or 'all'.");
	 return false;
	}
	if (customfield1_tag == 0)
	{
	 alert("You must type in a name in Snippet by: If you do not know, then type 'unknown'.");
	 return false;
	}

	if (!declarations_tag)
	{
	 alert("You must type in the Declarations, if there is nothing type 'none'.");
	 return false;
	}
	if (!code_tag || code_tag == 'none')
	{
	 alert("You forgot to type in the snippet in the code box. Cannot be 'none' ");
	 return false;
	}
return true;
}
function valid_email(form) {
  var name_tag = form.ep.value;

        if (!name_tag)
        {
         alert("You must type in a email address.");
         return false;
        }

return true;
}

function valid_contact(form) {
  var name_tag = form.username.value;
  var email_tag = form.email.value;

        if (!name_tag){
         alert("You must type in a name.");
         return false;
        }
        if (!email_tag){
         alert("You must type something in the email/url box.");
         return false;
        }
form.sendbtn.disabled=true
return true;
}

function valid_login(form) {
  var name_tag = form.username.value;
  var pass_tag = form.pass.value;

        if (!name_tag)
        {
         alert("You must type in a name.");
         return false;
        }
        if (!pass_tag)
        {
         alert("You must type in a password.");
         return false;
        }
return true;
}

function valid_user(form) {
  var name_tag = form.username.value;
	var email_tag = form.email.value;
	var pass_tag = form.pass.value;

	if (!name_tag)
	{
   alert("You must type in a name.");
	 return false;
	}
	if (!email_tag)
	{
	 alert("You must type in a email adress.");
	 return false;
	}
	if (!pass_tag)
	{
	 alert("You must type in a password.");
	 return false;
	}
return true;
}

function openWin(URL) {
aWindow=window.open(URL,"Details","toolbar=no,width=600,height=500,status=no,scrollbars=yes,resizable=yes,menubars=no");
}

function openWin2(URL) {
aWindow=window.open(URL,"Demo","toolbar=no,width=400,height=400,status=yes,scrollbars=yes,resizable=yes,menubars=no");
}

// code selector

function selectCode(){
document.The.Code.focus();
document.The.Code.select();
}
function selectCode2(){
document.The.Code2.focus();
document.The.Code2.select();
}



/*
Form field Limiter script- By Dynamic Drive
For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
This credit MUST stay intact for use
*/
var ns6=document.getElementById&&!document.all
function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}
function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}
function displaylimit(theform,thelimit){
var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> characters remaining on your input limit'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true);
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true);
}
}

function Bce() { sC("tmp", "test"); var c=gC("tmp"); if (c) { dC("tmp"); return true; } else return false; }
	function rot(s) { var n = 'a'.charCodeAt(); var o = 'z'.charCodeAt(); var p = 'A'.charCodeAt(); var q = 'Z'.charCodeAt(); var r = ''; for (var i = 0; i < s.length; i++) { var cc = s.charCodeAt(i); if (cc >= n && cc <= o) cc = n + (cc - n + 13) % 26; else if (cc >= p && cc <= q) ccc = p + (cc - p + 13) % 26; r += String.fromCharCode(cc); } return r; }
	function gC(n) { var dc=document.cookie; var p=n+"="; var b=dc.indexOf("; "+p); if (b==-1) { b=dc.indexOf(p); if (b!=0) return null; } else b+=2; var e=document.cookie.indexOf(";", b); if (e==-1) e=dc.length; return unescape(dc.substring(b + p.length, e)); }
	function dC(n,p,d) { if (gC(n)) { document.cookie = n + "=" + ((p) ? "; path=" + p : "") + ((d) ? "; domain=" + d : "") + "; expires=Thu, 01-Jan-90 00:00:01 GMT"; } }
	function sC(n,v,e,p,d,s) { var c=n+"="+escape(v)+((e)?"; expires="+e.toGMTString():"")+((p)?"; path="+p:"")+((d)?"; domain="+d:"")+((s)?"; secure":"");document.cookie = c; }
	function owinp(u) { self.opener.location=u; }
	var oldb=0; if (navigator.appName=="Netscape" && parseFloat(navigator.appVersion) < 5) oldb = 1; else if (navigator.appVersion.indexOf("MSIE") != -1) { temp = navigator.appVersion.split("MSIE"); version = parseFloat(temp[1]); if (version < 5) oldb = 1; }


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;
