
     $.fn.cycle.defaults.speed   = 500;  
     $.fn.cycle.defaults.timeout = 2000;  
     $(function() {  
        // run the code in the markup!  
         $('td pre code').each(function() {
             eval($(this).text());  
         });    
     }); 

    function showtextarea(toshow,tohide){
      preobj = document.getElementById(tohide).style;
	preobj.visibility = "hidden";
      obj = document.getElementById(toshow).style;
	obj.visibility    = "visible";   
    }

   function showtag(toshow,tohide1,tohide2){
     preobj1 = document.getElementById(tohide1).style;
     preobj1.visibility = "hidden";
     preobj2 = document.getElementById(tohide2).style;
     preobj2.visibility = "hidden";
     obj = document.getElementById(toshow).style;
     obj.visibility    = "visible";   
   }

   // Form Validation
    function vrf_email(tag) {
      if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(tag.value)){
       return (true) 
      }
      alert("<?php printf($erroremail);?>")
      tag.value = "";
      return (false)
    }
    function phone(t,dig){
      var i;
      if (t.length == dig) { 
        for (i = 0; i < t.length; i++)
        {
	    var c = t.charAt(i);   
	    if (((c < "0") || (c > "9"))) {
	      alert("<?php printf($errorphone);?>"); 
	      return false;
	    }
        }
      return true;
      } else {
        alert("<?php printf($errornodigits);?>");
        return false;
      }
    }
    function verify(obj,dig){
      if (dig == null){  dig = 3; };
      if (! phone(obj.value,dig)) {
        obj.value = "";
        obj.focus();
      }
    }
    function validate() {
      if (  document.subscribeform.firstname.value == "" || document.subscribeform.lastname.value == ""
         || document.subscribeform.city.value      == "" || document.subscribeform.state.value == "" 
         || document.subscribeform.country.value == ""   || document.subscribeform.personalphonearea.value == ""
         || document.subscribeform.personalphonenumber1.value == "" 
                                                         || document.subscribeform.personalphonenumber2.value == ""
         || document.subscribeform.email.value == "") {
        alert("<?php printf($errorreqfields);?>");
        if (document.subscribeform.firstname.value == "") { document.subscribeform.firstname.focus(); };
        if (document.subscribeform.lastname.value == "")  { document.subscribeform.lastname.focus();  };
        if (document.subscribeform.city.value == "")      { document.subscribeform.city.focus();      };
        if (document.subscribeform.state.value == "")     { document.subscribeform.state.focus();     };
        if (document.subscribeform.country.value == "")   { document.subscribeform.country.focus();   };
        if (document.subscribeform.personalphonearea.value  == "") { document.subscribeform.personalphonearea.focus();  };
        if (document.subscribeform.personalphonenumber1.value == "") { document.subscribeform.personalphonenumber1.focus(); };
        if (document.subscribeform.personalphonenumber2.value == "") { document.subscribeform.personalphonenumber2.focus(); };
        if (document.subscribeform.email.value == "") { document.subscribeform.email.focus(); };
        return false;
      } else {
        document.subscribeform.submit();
        return true;
      }
    }
    function showmenu(option) {
        help = document.getElementById(option).style;
        help.display = 'inline';
        document.getElementById(option).style = help;       
    }
    function hidemenu(option) {
        help = document.getElementById(option).style;
        help.display = "none";
        document.getElementById(option).style = help;
    }

