<!--
//************ Start Default Commands ************
function getQuery(val){
  var querystring = location.search.substring(1,location.search.length);
  var o = "";
  var tSec = querystring.indexOf(val+"=");
  var tStr = querystring.substring( (tSec+(val.length+1)),querystring.length);
  
  if(tSec != -1){
    if(tStr.indexOf('&') != -1){
      o = tStr.substring(0,tStr.indexOf('&'));
    } else {
      o = tStr;
    }
  }
  return o;
}

function replaceSubstring(s,f,w){
  rtn = "";
  flg = 0;
  
  for(i = 0; i < s.length; i++){
    if(s.substr(i,f.length) == f){
      rtn += w;
      i += (f.length - 1);
    } else {
      rtn += s.charAt(i);
    }
  }
  return (rtn);
}

function urlencode(str) {
  str = escape(str);
  str = str.replace('+', '%2B');
  str = str.replace('%20', '+');
  str = str.replace('*', '%2A');
  str = str.replace('/', '%2F');
  str = str.replace('@', '%40');
  return str;
}

function testAlphaPassword(f,d){
  if(d == ""){ d = 0; }
  var doc = document.forms[d];
  var ele = doc.elements[f];
  var str = false;

  if(ele.value == ""){
    alert("Please enter a password");
  } else {
    if(/[^a-zA-z0-9]/i.test(ele.value)){
      alert("Sorry, your password may only contain letters and numbers");
    } else {
      str = true;
    }
  }
  return str;
}

function getCookie(Name){ 
  var search = Name + "=" 
  if(document.cookie.length > 0){
    offset = document.cookie.indexOf(search);
    if(offset != -1){
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if(end == -1){ end = document.cookie.length; }
      return unescape(document.cookie.substring(offset, end)) ;
    }
  } 
} 

function setCookie(name, value) {
  var today = new Date(); 
  expires = new Date(); 
  expires.setTime(today.getTime() + 1000*60*60*24*1);
  document.cookie = name + "=" + value + ";path=/;expires=" + expires.toGMTString();
}

function goPage(u){
  location.href = u;
}

//************ End Default Commands ************
function updatePage(d){
  if(d == ""){ d = 0; }
  var doc = document.forms[d];
  doc.submit();
}

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

//********* jQuery **********
$(document).ready(function(){
  //---------------------BACKGROUND IMAGE---------------------//
  var pos = Math.round($('#page_container').offset().left);
  if(pos > 0){ amt = (pos-65); } else { amt = "-65"; }
  $('#header').css('background-position',amt + 'px 0');

  $(window).resize(function(){
    var pos = Math.round($('#page_container').offset().left);
    if(pos > 0){ amt = (pos-65); } else { amt = "-65"; }
    $('#header').css('background-position',amt + 'px 0');
  });
  //---------------------BACKGROUND IMAGE---------------------//

  Cufon.replace('.main_box h1, .main_box h2, #page_footer p, .side_panel h2');

  $('ul.lineup:first').css('margin-left','0');
  $('ul.lineup:last').css('margin-right','0');

/*
  var hary = new Array();
  $('ul.lineup').each(function(){ hary.push($(this).height()); }); hary.sort();
  $('ul.lineup').each(function(){ $(this).css('height',hary[hary.length-1] + 'px'); });

  var hpary = new Array();
  $('ul.lineup_hp').each(function(){ hpary.push($(this).height()); }); hpary.sort();
  $('ul.lineup_hp').each(function(){ $(this).css('height',hpary[hpary.length-1] + 'px'); });

  var ctary = new Array();
  $('ul.lineup_ct').each(function(){ ctary.push($(this).height()); }); ctary.sort();
  $('ul.lineup_ct').each(function(){ $(this).css('height',ctary[ctary.length-1] + 'px'); });
*/
  $('div.payment_options p:first').css('margin-right','5px');

});


//-->

