﻿function clearForm(oForm) 
{
  var elements = oForm.elements; 
  oForm.reset();
  for(i=0; i<elements.length; i++) 
{
  field_type = elements[i].type.toLowerCase();
  switch(field_type) 
{
    case "text": 
    case "password": 
    case "textarea":
    case "hidden":   
      elements[i].value = ""; 
      break;
    case "radio":
    case "checkbox":
        if (elements[i].checked) 
        {
          elements[i].checked = false; 
        }
      break;
    case "select-one":
    case "select-multi":
       elements[i].selectedIndex = -1;
      break;
    default: 
      break;
}
}
}

// <!--
function validateForm(theForm)
{
     var isPhone = /[0-9]{3}-[0-9]{3}-[0-9]{4}/i;  //000-000-0000
     var s = theForm.DaytimePhone.value;
     var isEmail = /^[a-z][a-z0-9]*([.\-_][a-z][a-z0-9]*)*@([a-z][a-z0-9]*.)*([a-z]{2}|com|net|org|biz|gov|pro|int|mil|edu|info|name|aero|coop|museum)$/i;
     if(theForm.Name.value.split(" ").join("") == "")
     {
          alert("Please enter your Name.");
          theForm.Name.select();
          theForm.Name.focus();
          return (false);
     }
     if(theForm.Name.value.length > 70)
     {
          alert("Please enter at most 70 characters in the Name field.");
         theForm.Name.focus();
         return (false);
     }
     if(theForm.EmailAddress.value.split(" ").join("") == "")
     {
          alert("Please enter a Email Address.");
          theForm.EmailAddress.select();
          theForm.EmailAddress.focus();
          return (false);
     }
     if (!isEmail.test(theForm.EmailAddress.value))
     {
         alert("The Email Address is NOT in the corect format.");
         theForm.EmailAddress.focus();
         return (false);
     }
      if (theForm.EmailAddress.value.length > 35)
       {
         alert("Please enter at most 35 characters in the Email Address field.");
         theForm.EmailAddress.focus();
         return (false);
       }
     if (theForm.DaytimePhone.value.split(" ").join("") == "")
     {
          alert("Please enter a Daytime Phone Number.");
          theForm.DaytimePhone.select();
          theForm.DaytimePhone.focus();
          return (false);
     }
     if (isPhone.exec(s) > -1)
     {
          alert("The Phone Number is NOT in the correct format:\n...000-000-0000.");
          theForm.DaytimePhone.focus();
          return (false);
     }
     if (theForm.DaytimePhone.value.length > 14)
     {
          alert("Please enter at most 14 characters in the \"Daytime Phone\" field.");
          theForm.DaytimePhone.focus();
          return (false);
     }
     return (true);
}
// -->

    <!--// 
 var lastusertel="";
 function phoneMask(usertel)
{
     var m1 =usertel.value.match(/^[0-9]{3}$/);
     var m2 =usertel.value.match(/^[0-9]{3}-[0-9]{3}$/);
     if(m2){usertel.value=m2+"-";return}
     if(m1){usertel.value=m1+"-"; return}
}
 var doSubmit = true;
 function checkPhone(usertel)
{
        if( (usertel.value != "") && (/[0-9]{3}-[0-9]{3}-[0-9]{4}/i.exec(usertel.value) > -1) ) {
        doSubmit = false;
        window.alert("The phone number must be in this format: 123-456-7890.\n");
        usertel.focus();
        return;
        } else {
            doSubmit = true;
     }
}
    //-->

function breakout_of_frame()
{
 if (top.location != location) {
    top.location.href = document.location.href ;
  }
}

// google analytics tracker
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-20036820-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

function showHide(shID) {
        if (document.getElementById(shID)) {
          if (document.getElementById(shID).style.display != 'none') {
            document.getElementById(shID).style.display = 'none';
          }
          else {
            document.getElementById(shID).style.display = 'inline';
          }
        }
      }

  //includes js files for the application
function include(file)
{
    var script  = document.createElement('script');
    script.src  = file;
    script.type = 'text/javascript';
    script.defer = true;

    document.getElementsByTagName('head').item(0).appendChild(script);
}

//include javascript file here
//include('https://apis.google.com/js/plusone.js'); 
//include('http://detect.deviceatlas.com/redirect.js?d=http://www.orlando-web-hosting.net&amp;m=http://www.orlando-web-hosting.mobi');
//include('http://connect.facebook.net/en_US/all.js#xfbml=1');
include('http://cdn.wibiya.com/Toolbars/dir_0775/Toolbar_775124/Loader_775124.js');

