function go_url(url)
{
location= url;
} 

function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length-1; i++) {
    document.preloadlist[top+i] = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function na_change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src = rpath;
  } 
}

function onlyDigit(el) 
{
    el.value = el.value.replace(/\D/g,'');
}

function go_back() 
{
    history.go(-1);
}

function go_replace(url) 
{
    location.replace(url);
}

function ProtectDouble(tmp)
{
    document.getElementById(tmp).disabled = true;
    setTimeout("document.getElementById('"+tmp+"').disabled = false", 3000);
}

function go_linkwindow(link)
{  
    window.open(link);
}

function expandPremium()
{   
    if(document.edit_form.bdPremium.checked == true)
    {
        document.getElementById("tr_expand_premium").style.display = "";
    }
    else if(document.edit_form.bdPremium.checked == false)
    {
        document.getElementById("tr_expand_premium").style.display = "none";
    }
}
function onlyEnglish(el) 
{
    onvalue = el.value;
    
    if ((onvalue.search(/[^a-z0-9]/) != -1) || (onvalue == "")) 
    {
        el.value = "";
        el.focus();
        return false;
    }
}

function emailvalidate(form_id,email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.forms[form_id].elements[email].value;
   if(reg.test(address) == false) {
        message_box("Check Again","Invalid Email Address");
      return false;
   }
   return true;
}

function emailvalidate2(email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   if(reg.test(email) == false) {
        message_box("Check Again","Invalid Email Address");
      return false;
   }
   return true;
}
/* Show appropriate region input when a country is selected. */
function selectCountry( select, prefix ) {
    var postalCode = document.getElementById( prefix + "_postalCode" );
    var state = document.getElementById( prefix + "_state" );
    var province = document.getElementById( prefix + "_province" );
    var region = document.getElementById( prefix + "_region" );
    if ( select.value == "US" ) {
        if ( state ) state.style.display = "";
        if ( province ) province.style.display = "none";
        if ( region ) region.style.display = "none";
        if ( postalCode ) postalCode.innerHTML = "ZIP Code";
    } else if ( select.value == "CA" ) {
        if ( state ) state.style.display = "none";
        if ( province ) province.style.display = "";
        if ( region ) region.style.display = "none";
        if ( postalCode ) postalCode.innerHTML = "Postal Code";
    } else {
        if ( state ) state.style.display = "none";
        if ( province ) province.style.display = "none";
        if ( region ) region.style.display = "";
        if ( postalCode ) postalCode.innerHTML = "Postal Code";
    }
} 

function toggle( id ) 
{
    var item = document.getElementById( id );
    if ( item.style.display == "none" ) 
    {
        item.style.display = "";
    } 
    else 
    {
        item.style.display = "none";
    }
}

