  function PopUpWindow(url,name,features) {
    hWnd=window.open(url,name,features);
    hWnd.focus();
  }

  function ValidateEmail (emailStr) {
  var emailPat=/^(.+)@(.+)$/
  var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
  var validChars="\[^\\s" + specialChars + "\]"
  var quotedUser="(\"[^\"]*\")"
  var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
  var atom=validChars + '+'
  var word="(" + atom + "|" + quotedUser + ")"
  var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
  var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
  var matchArray=emailStr.match(emailPat)
  if (matchArray==null) {
    alert("Email address seems incorrect (check @ and .'s)")
    return false
  }
  var user=matchArray[1]
  var domain=matchArray[2]
  if (user.match(userPat)==null) {
      alert("The username doesn't seem to be valid.")
      return false
  }
  var IPArray=domain.match(ipDomainPat)
  if (IPArray!=null) {
      for (var i=1;i<=4;i++) {
        if (IPArray[i]>255) {
            alert("Destination IP address is invalid!")
       return false
       }
     }
     return true
  }
  var domainArray=domain.match(domainPat)
  if (domainArray==null) {
    alert("The domain name doesn't seem to be valid.")
      return false
  }
  var atomPat=new RegExp(atom,"g")
  var domArr=domain.match(atomPat)
  var len=domArr.length
  if (domArr[domArr.length-1].length<2 ||
     domArr[domArr.length-1].length>4) {
     alert("The address must end in a three(or four)-letter domain, or two letter country.")
     return false
  }
  if (len<2) {
     var errStr="This address is missing a hostname!"
     alert(errStr)
     return false
  }
  return true;
  }

function doRefine(selectList) {
	var elmName = selectList.name;
	var selIndex = selectList.selectedIndex;
	var url = selectList.options[selIndex].value;
	if (url != "-1") {
		//alert(elmName + ":" + selIndex + ":" + url);
		location = url;
	}
}

function doSearch(url) {
  // Get search property and term values from form elements
  if (document.search_form.searchField.value.length > 0) {
    var searchTerm    = document.search_form.searchField.value;
    searchTerm = searchTerm.replace(/^\s*|\s*$/g, "");
    if (searchTerm.length > 0) {
      url = url + "&N=0&Ntx=mode+matchallpartial&Ntk=All&Ntt=" + searchTerm +"&Nty=1" ;
      location = url;
    } else {
      alert("Please provide a search term");
    }
  }
  else
    alert("Please provide a search term");
}

/*

  function add_option(select, value, text) {
    var index = select.options.length ;
    select.options.length       = index + 1;
    select.options[index].text  = text ;
    select.options[index].value = value ;
  }

  function ins_ps_manuf(select) {
    select.options.length = 1;
    add_option(select,"921787","About Face Design");
    add_option(select,"281894","Adams");
    add_option(select,"275977","Adidas");
    add_option(select,"282198","Alien");
    add_option(select,"946448","Arnold Palmer");
    add_option(select,"275937","Ashworth");
    add_option(select,"275521","Bag Boy");
    add_option(select,"1537663","Bally");
    add_option(select,"275717","Belding");
    add_option(select,"282202","Ben Hogan");
    add_option(select,"278737","Bite");
    add_option(select,"287930","Bolle");
    add_option(select,"288084","Booklegger");
    add_option(select,"1539949","Burton Golf");
    add_option(select,"287903","Bushnell");
    add_option(select,"275543","Callaway");
    add_option(select,"282559","Carbite");
    add_option(select,"278307","Champ");
    add_option(select,"276615","Chiliwear");
    add_option(select,"282014","Cleveland");
    add_option(select,"275817","Club Glove");
    add_option(select,"922953","Club Pro Products");  
    add_option(select,"923257","Clubhouse Golf");
    add_option(select,"281980","Cobra");
    add_option(select,"882821","Coleman");
    add_option(select,"922641","Cotton Traders");  
    add_option(select,"276318","Cross Creek");
    add_option(select,"275960","Cutter & Buck");
    add_option(select,"275537","Datrek");
    add_option(select,"922944","David Leadbetter"); 
    add_option(select,"287482","Desperado");
    add_option(select,"278576","Dexter");
    add_option(select,"286937","Dorfman Pacific");
    add_option(select,"287485","Dunlop");
    add_option(select,"278504","Eagle Jack");
    add_option(select,"898355","Ecco");
    add_option(select,"924457","Enmon");  
    add_option(select,"923694","EP Pro");  
    add_option(select,"277812","Etonic");  
    add_option(select,"1538174","Ever Tan");
    add_option(select,"923256","Fairway Outfitters");
    add_option(select,"276009","Footjoy");
    add_option(select,"284287","Forresters");
    add_option(select,"921858","Fort Golf"); 
    add_option(select,"1368414","Fossil");  
    add_option(select,"947170","Gear For Golf");
    add_option(select,"1538117","Glove It");
    add_option(select,"275510","Golfsmith");
    add_option(select,"923255","Golo");  
    add_option(select,"922666","Gotta Have It Golf");  
    add_option(select,"925755","Great American");
    add_option(select,"1539950","Green Divas");
    add_option(select,"275940","Greg Norman");
    add_option(select,"288048","Gustbuster");
    add_option(select,"282688","Hog Golf");
    add_option(select,"275789","Hot-Z");
    add_option(select,"1532980","Inside Approach");
    add_option(select,"275513","Izzo");
    add_option(select,"923259","Jamie Sadock"); 
    add_option(select,"1401126","K-Bell");
    add_option(select,"275924","Kallassy");
    add_option(select,"275740","Killer Bee");
    add_option(select,"921792","KLR"); 
    add_option(select,"924215","Knockout Specialities"); 
    add_option(select,"922642","Kurt Adler");   
    add_option(select,"281872","La Jolla");
    add_option(select,"285739","Lamkin");
    add_option(select,"890754","Lady Fairway");
    add_option(select,"282746","Liquid Metal");
    add_option(select,"1539339","LPGA");
    add_option(select,"924456","Lumin Air"); 
    add_option(select,"275533","Lynx");
    add_option(select,"895465","MacGregor");
    add_option(select,"275809","Maxfli");
    add_option(select,"282815","Mizuno");
    add_option(select,"288184","Momentus");
    add_option(select,"281948","Nancy Lopez");
    add_option(select,"282648","Never Compromise");
    add_option(select,"282633","NGC");
    add_option(select,"1542560","Nickent");
    add_option(select,"275585","Nike");
    add_option(select,"287925","NYX Golf");
    add_option(select,"867696","Oakley");
    add_option(select,"282774","Odyssey");
    add_option(select,"895813","Ogio");
    add_option(select,"282732","Orlimar");
    add_option(select,"275839","Par Classics");
    add_option(select,"276743","PGA Tour");
    add_option(select,"279616","Phoenixx TPC");
    add_option(select,"276353","Pine State Knit");
    add_option(select,"275606","Ping");
    add_option(select,"287563","Pinnacle");
    add_option(select,"287459","Precept");
    add_option(select,"275619","Pro Select");
    add_option(select,"276720","Purespin");
    add_option(select,"281975","Ram");
    add_option(select,"278222","Reebok");
    add_option(select,"275890","Sabona");
    add_option(select,"276083","Sansabelt");
    add_option(select,"283133","Scotty Cameron");
    add_option(select,"275826","SKB");
    add_option(select,"287824","Sky Golf");
    add_option(select,"275624","Snake Eyes");
    add_option(select,"278295","Softspikes");
    add_option(select,"895538","Sonartec");
    add_option(select,"278794","Spalding");
    add_option(select,"1532304","Square II");
    add_option(select,"945616","Srixon");
    add_option(select,"933723","Stealth");
    add_option(select,"276038","Sterling");
    add_option(select,"286868","Strata");
    add_option(select,"283176","STX");
    add_option(select,"1539414","Sun Ice");
    add_option(select,"275526","Sun Mountain");
    add_option(select,"275973","Tabasco");
    add_option(select,"278630","Tags");
    add_option(select,"1539948","Tail");
    add_option(select,"275662","Taylor Made");
    add_option(select,"283490","Tear Drop");
    add_option(select,"945285","Tehama");
    add_option(select,"893422","The Perfect Club");
    add_option(select,"922955","Thirstystone");      
    add_option(select,"275656","Titleist");
    add_option(select,"281996","Tommy Armour");
    add_option(select,"925536","Tommy Hilfiger");  
    add_option(select,"281967","Top Flite");
    add_option(select,"275755","Wilson");
    add_option(select,"922945","Wine & Spirits");  
    add_option(select,"278635","Woodlored");
    add_option(select,"1205418","Yonex");
    add_option(select,"896961","Zevo");
  }

  function ins_cm_manuf(select) {
    select.options.length = 1;
    add_option(select,"#","FEATURED BRANDS");
    add_option(select,"275624"," Snake Eyes");
    add_option(select,"275510"," Golfsmith");
    add_option(select,"283728"," Zebra");
    add_option(select,"275740"," Killer Bee");
    add_option(select,"279318"," True Temper");
    add_option(select,"279404"," UST");
    add_option(select,"279335"," Grafalloy");
    add_option(select,"279384"," Aldila");
    add_option(select,"285771"," Golf Pride");
    add_option(select,"285754"," Winn");
    add_option(select,"285739"," Lamkin");
    add_option(select,""," ");
    add_option(select,"#","ALL BRANDS");
    add_option(select,"929504","Accuflex");
    add_option(select,"279629","Aero-Tech Sports");
    add_option(select,"279384","Aldila");
    add_option(select,"279338","Apollo");
    add_option(select,"285714","Avon");
    add_option(select,"275543","Callaway");
    add_option(select,"282559","Carbite");
    add_option(select,"282014","Cleveland");
    add_option(select,"888468","C-Thru Grips");
    add_option(select,"279533","Fenwick");
    add_option(select,"929385","Fujikura");
    add_option(select,"285771","Golf Pride");
    add_option(select,"275510","Golfsmith");
    add_option(select,"279335","Grafalloy");
    add_option(select,"279554","Graphite Design");
    add_option(select,"887125","Harmon Brothers");
    add_option(select,"279392","Harrison Sports");
    add_option(select,"279311","Harvey Penick");
    add_option(select,"275740","Killer Bee");
    add_option(select,"285739","Lamkin");
    add_option(select,"282746","Liquid Metal");
    add_option(select,"927240","Medallist"); 
    add_option(select,"282732","Orlimar");
    add_option(select,"279395","Paragon");
    add_option(select,"279596","Penley");
    add_option(select,"279616","Phoenixx TPC");
    add_option(select,"275606","Ping");
    add_option(select,"285822","Positrac");
    add_option(select,"285849","Royal");
    add_option(select,"942461","Royal Precision");
    add_option(select,"275624","Snake Eyes");
    add_option(select,"881626","Spalding Custom");
    add_option(select,"275662","Taylor Made");
    add_option(select,"279318","True Temper");
    add_option(select,"279404","UST");
    add_option(select,"285754","Winn");
    add_option(select,"279314","XPC");
    add_option(select,"283728","Zebra");
  }
*/

  function display_menu(border_type, menu_level, link_name, image_name) {
    // border_type: 1=top, 2=bottom, 3=both
    // menu_level: 0=no menu, 1..n=menu level
    // image_name: for menu option
    if (border_type == 1 || border_type == 3) {
      window.document.write('<tr>') ;
      window.document.write("<td class=\"tableBorder\" width=139><img src=\"images/spacer.gif\" width=\"139\" height=\"1\"><br></td>") ;
      window.document.write('</tr>') ;
    }      
    window.document.write('<tr>') ;
    window.document.write("<td align=\"right\" valign=\"middle\">") ;
    window.document.write("<A HREF=\"" + link_name + "\" class=leftnav_img") ;
    if (menu_level > 0) {
      window.document.write(" onMouseOver=\"HM_f_PopUp(\'elMenu" + menu_level + "\',event)\" onMouseOut=\"HM_f_PopDown(\'elMenu" + menu_level + "\')\"") ;
    }
    window.document.write("><img src=\"" + image_name + "\" width=139 height=19 border=0></a></td>") ;
    window.document.write('</tr>') ;
    if (border_type == 2 || border_type == 3) {
      window.document.write('<tr>') ;
      window.document.write("<td class=\"tableBorder\" width=139><img src=\"images/spacer.gif\" width=\"139\" height=\"1\"><br></td>") ;
      window.document.write('</tr>') ;
    }
  }

  function display_ps_menu() {
    display_menu(3, 1, 'search_display.php?ob=M&ns=Y&cat=280951|', 'images/nav_ps_clubs.gif') ;
    display_menu(2, 0, 'search_display.php?ob=M&ns=Y&cat=287458', 'images/nav_ps_balls.gif') ;
    display_menu(2, 2, 'search_display.php?ob=M&ns=Y&cat=392197|', 'images/nav_ps_bags.gif') ;
    display_menu(2, 3, 'search_display.php?ob=M&ns=Y&cat=392199|', 'images/nav_ps_apparel.gif') ;
    display_menu(2, 0, 'search_display.php?ob=M&ns=Y&cat=277591', 'images/nav_ps_shoes.gif') ;
    display_menu(2, 0, 'search_display.php?ob=M&ns=Y&cat=275814', 'images/nav_ps_travel.gif') ;
    display_menu(2, 0, 'search_display.php?ob=M&ns=Y&cat=286168', 'images/nav_ps_gloves.gif') ;
    display_menu(2, 0, 'search_display.php?ob=M&ns=Y&cat=286511', 'images/nav_ps_gifts.gif') ;
    display_menu(2, 0, 'search_display.php?ob=M&ns=Y&cat=275923', 'images/nav_ps_training.gif') ;
    display_menu(2, 0, 'search_display.php?ob=M&ns=Y&cat=275863', 'images/nav_ps_books.gif') ;
    display_menu(2, 4, 'search_display.php?ob=M&ns=Y&cat=286159|', 'images/nav_ps_grips.gif') ;
    display_menu(2, 5, 'search_display.php?ob=M&ns=Y&cat=275933|', 'images/nav_ps_accessories.gif') ;
  }

  function display_cm_menu() {
    display_menu(3, 0, 'search_display.php?ob=M&ns=Y&cat=284663', 'images/nav_cm_wood.gif') ;
    display_menu(2, 0, 'search_display.php?ob=M&ns=Y&cat=284598', 'images/nav_cm_iron.gif') ;
    display_menu(2, 0, 'search_display.php?ob=M&ns=Y&cat=285217', 'images/nav_cm_putter.gif') ;
    display_menu(2, 0, 'search_display.php?ob=M&ns=Y&cat=284855', 'images/nav_cm_wedge.gif') ;
    display_menu(2, 0, 'search_display.php?ob=M&ns=Y&cat=392201|', 'images/nav_cm_headcovers.gif') ;
    display_menu(2, 1, 'search_display.php?ob=M&ns=Y&cat=286159|', 'images/nav_cm_grips.gif') ;
    display_menu(2, 2, 'search_display.php?ob=M&ns=Y&cat=277222|', 'images/nav_cm_tools.gif') ;
    display_menu(2, 3, 'search_display.php?ob=M&ns=Y&cat=392203|', 'images/nav_cm_shafts.gif') ;
    display_menu(2, 4, 'search_display.php?ob=M&ns=Y&cat=392204|', 'images/nav_cm_supplies.gif') ;
    display_menu(2, 0, 'search_display.php?ns=Y&fcst=ACTIVECOMP&ob=M&vt=IMAGE&at1=HAND&av1=L', 'images/nav_cm_lefthand.gif') ;
    display_menu(2, 0, 'display_page.php?page_num=junior_components', 'images/nav_cm_junior.gif') ;
    display_menu(2, 0, 'search_display.php?ob=C&ns=Y&manuf=275624', 'images/nav_cm_snake.gif') ;
    display_menu(2, 0, 'search_display.php?ob=C&ns=Y&manuf=275740', 'images/nav_cm_killer.gif') ;
    display_menu(2, 0, 'search_display.php?ob=C&ns=Y&manuf=279311', 'images/nav_cm_penick.gif') ;
    display_menu(2, 0, 'search_display.php?ob=C&ns=Y&manuf=881626', 'images/nav_cm_spalding.gif') ;
  }

  /*****************site redesign 4/2006 ******************/
  


function check_review_compatability(){  //bv errors on IE versions prior to 6.0
    var browser=navigator.appName;
     
    if(browser=="Microsoft Internet Explorer"){
        
      var version=navigator.appVersion;
      var b_version_array=version.split('compatible; MSIE');
      var version_number_array=b_version_array[1].split(';');
      var version_number= version_number_array[0];
      version_number=parseFloat(version_number);
      if(version_number < 6){
            return false;           
        }
        else {
            return true;
        }
    }
    
    else {
        return true;
    }
    
}
  
  function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();


function handleResponse() {
    if(http.readyState == 4){
        var response = http.responseText;
        document.getElementById('prod_detail').innerHTML = response; //update[1];
    }
}


  
function chg_tab(tab){
    
   if(check_review_compatability()){
     var desc_tab_html = "<a href='#'><img src=\"/images/buttons/ppage_tab_descript_on.gif\" width=\"93\" height=\"26\" border=\"0\" onclick=\"chg_tab('desc');\"><img src=\"/images/buttons/ppage_tab_reviews_off.gif\" width=\"120\" height=\"26\" border=\"0\" onclick=\"chg_tab('rev');\"></a>";
     var rev_tab_html = "<a href='#'><img src=\"/images/buttons/ppage_tab_descript_off.gif\" width=\"93\" height=\"26\" border=\"0\" onclick=\"chg_tab('desc');\"><img src=\"/images/buttons/ppage_tab_reviews_on.gif\" width=\"120\" height=\"26\" border=\"0\" onclick=\"chg_tab('rev');\"></a>";
     if(tab=='desc'){
      document.getElementById('tabs').innerHTML=desc_tab_html;
      http.open('get', '../ppage.php?service=prod_desc&p_style_number=171' ); //+ p_style_number + '&p_forcast=' + p_forcast);
      http.onreadystatechange = handleResponse;
      http.send(null);
       }
     if(tab=='rev'){
      document.getElementById('tabs').innerHTML=rev_tab_html;
      var site= '../ppage.php?service=prod_rev&p_style_number=' + p_style_number + '&p_forcast=' + p_forcast;
      http.open('get', site);
      http.onreadystatechange = handleResponse;
      http.send(null);
    }
  }
    
}
