/* $Id: jscript.js,v 1.0 2007-01-05 22:34:57-08 dad Exp dad $
// vim: expandtab sw=4 ts=4 sts=4:*/
/*
########################################################################
## Built2Go PHP Webhosting Review v1.0                                ##
## ----------------------------------------------------------------   ##
## Copyright © Big Resources, Inc. All Rights Reserved.               ##
## This software must be used in accordance with its licensing        ##
## terms and conditions at: http://www.built2go.com/faq.php           ##
##                                                                    ##
## This file may not be redistributed in whole or significant part.   ##
## ---------------- BUILT2GO IS NOT FREE SOFTWARE -----------------   ##
########################################################################

*/
//<!--


function openWin(URL) {
aWindow=window.open(URL,"New","toolbar=no,width=600,height=640,status=no,scrollbars=1,menubars=no");
}


function CheckSponsor(form) {
   f = form;

   for(var i=0;i<f.elements.length;i++){
       if (f.elements[i].type!="text"){
           continue;
       }
       t = f.elements[i].value;

       if(t == null || t.length == 0){
           var et = f.elements[i].getAttribute("errortext");
           alert(et);
           f.elements[i].focus();
           return false;
       }
   }

  return true;
}

function CheckSignup(form) {
   f = form;

   for(var i=0;i<f.elements.length;i++){
       if (f.elements[i].type!="text" && f.elements[i].type!="password"){
           continue;
       }
       t = f.elements[i].value;

       if(t == null || t.length == 0 && (f.elements[i].name == "username" || f.elements[i].name == "pass"
       || f.elements[i].name == "repass") ){
           var et = f.elements[i].getAttribute("errortext");
           alert(et);
           f.elements[i].focus();
           return false;
       }
   }



return true;
}


function valid_review(form) {
   f = form;

   for(var i=0;i<f.elements.length;i++){
       if (f.elements[i].type!="text"){
           continue;
       }
       t = f.elements[i].value;
       if(t == null || t.length == 0 && (f.elements[i].name == "title" || f.elements[i].name == "security_try")){
           var et = f.elements[i].getAttribute("errortext");
           alert(et);
           f.elements[i].focus();
           return false;
       }
   }

  var vote = f.voteval.value;
  var cat = f.cid.value;
  var desc1 = f.areview.value;
  if (cat == 0){
	  var et = f.cid.getAttribute("errortext");
      alert(et);
      f.cid.focus();
     return false;
	}

 if (desc1 == ''){
	 var et = f.areview.getAttribute("errortext");
     alert(et);
     f.areview.focus();
     return false;
	}
  if (vote == ''){
	 var et = f.voteval.getAttribute("errortext");
     alert(et);
     f.voteval.focus();
     return false;
	}

return true;
}



function valid_cc(form) {
   f = form;
   var x_country_tag = form.country.value;
   for(var i=0;i<f.elements.length;i++){
       if (f.elements[i].type!="text" && f.elements[i].type!="password"){
           continue;
       }
       t = f.elements[i].value;

       if(t == null || t.length == 0 && f.elements[i].name != "x_company" && f.elements[i].name != "Street2"){
           var et = f.elements[i].getAttribute("errortext");
           alert(et);
           f.elements[i].focus();
           return false;
       }
   }
   	if (x_country_tag == 0)
    	{
       alert("You need to pick your country.");
       form.country.focus()
    	 return false;
    	}

return true;
}

function checkform(form) {
   f = form;

   for(var i=0;i<f.elements.length;i++){
       if (f.elements[i].type!="text"){
           continue;
       }
       t = f.elements[i].value;


       if(t == null || t.length == 0 ){
               var et = f.elements[i].getAttribute("errortext");
               alert(et);
               f.elements[i].focus();
               return false;
       }
   }
  document.frmMail.hidaction.value="submitform";
  return true;
}




function confirm_del() {
	pmbox=confirm("Warning: Are you sure you want to totally delete this?");
	if (pmbox==true) { // Output when OK is clicked
		return;
	} else {
	// Output when Cancel is clicked
	return false;
	}
}
function change_image(link,num,pic,wpic,hpic,path){
	aSlide = document.getElementById( 'slide' );
	aSlide.href = link;
	aChild = aSlide.getElementsByTagName( 'img' );
	aChild[0].src = path + pic;
    aChild[0].width=wpic;
    aChild[0].height=hpic;
    return false;
}
function openWindow(obj){

	features = "width=500,height=500";
	features += ",left=10,top=10,location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes";
	webwindow=window.open(obj, 'webwindow1', features);
	if (parseInt(navigator.appVersion) >= 4) { 
		webwindow.window.focus(); 
	}
}

function AddClick(){
	document.spay.submit();
}

function AddClickReset(){
    document.spay.clickqty.value="1";
   document.spay.submit();
}

function FrmChange() {
  var i = document.itemform.cid.options[document.itemform.cid.selectedIndex].value;
  document.itemform.frmcatid.value = i;
  document.itemform.action.value = '';
  document.itemform.dos.value = 'new';
  document.itemform.submit();
}

window.onload=function () {
document.getElementById('slide').onclick=function() {window.open(this.src,"pic","height=50, width=50");}
}