  function setTabFocus(e, tabName) {
    var key;
    if (window.event) key = e.keyCode;
    if (e.which) key = e.which;
    if (key != 13) return;
    changeDetailPageTab(tabName);
  }

function openDetailTabPopup(url) {
       
    window_handle = window.open(url,'ProductDetail',"location=0,menubar=0,resizable=no,height=550,width=600,scrollbars=yes,left=220,screenX=220,top=70,screenY=70"
                              );
    if( window_handle ){
        window_handle.focus();
    }
  } 
/******************************************************************************************************/

 function changeDetailPageTab1(tabName) {

    for (var i in tabArray1) {
    
      var tabObj = tabArray1[i];
      
      if (tabObj == null)
        continue;
        
      // set the tab image to 'on' or 'off'
      var tab = document.getElementById('tab_' + tabObj.name);
      if (tab != null){
        tab.type = "image";
        if (tabObj.name == tabName)
          tab.src = tabObj.onImg;
        else
          tab.src = tabObj.offImg;
      }
      // show this tab, hide all others
      var div = document.getElementById('div_' + tabObj.name);
      if (div != null)
        if (tabObj.name == tabName) 
          div.style.display = "block";
        else
          div.style.display = "none";
      // Turn the accessibility images off.
       var div2 = document.getElementById('access_' + tabObj.name);
       if (div2 != null) 
          div2.style.display = "none";
  
    } // foreach tab

    // remeber which tab is selected
    selectedDetailTabName = tabName;
   
    // Handle accessibility text.
    var access = document.getElementById('ddiv');
    var text = "There are " + tabArray.length + " buttons in the next section, to make the tab readable click it and navigate past the buttons. The currently selected tab is " + tabName + ".";
    access.innerHTML = text;
 
    // hide or display the "see more info" link
    var moreInfoLink = document.getElementById('moreInfoLink');
    if (moreInfoLink != null) {
      if (tabObj.enableMoreInfoLink)
        moreInfoLink.style.display = "block";
      else
        moreInfoLink.style.display = "none";
    }
    

  }



/*****************************************************************************************************/

/*function change_img(img_m_size,img_s_size)
{
	
	 
	if(document.all)
	 {
	  var obj=document.all.mainimg;
	  var obj_a=document.all.mainimg_a;
	 }
	 
	else if(document.getElementById)
	 {
		 var obj=document.getElementById('mainimg');
		 var obj_a=document.getElementById('mainimg_a');
	 }
	 
	obj.src=img_m_size;
	obj_a.href=img_s_size;
}*/
function change_img(img_m_size,img_s_size)
{
	
	 
	if(document.all)
	 {
	  var obj=document.all.mainimg;
	  var obj_a=document.all.mainimg_a;
	 }
	 
	else if(document.getElementById)
	 {
		 var obj=document.getElementById('mainimg');
		 var obj_a=document.getElementById('mainimg_a');
	 }
	 
	obj.src=img_m_size;
	sImages=img_s_size;
}
function imagePopup()
{
	var dwid = null;
	var imageURL = sImages;
	
	dwid = window.open("http://www.bikeapparels.com/image.php?URL=" + imageURL, "ImageWindow", "HEIGHT=400,WIDTH=300,TOOLBAR=0,RESIZABLE=1,SCROLLBARS=1,MENUBAR=0", true);  
	dwid.focus();
}


function change_img2(source)
{
	if(document.all)
	 {
	  var obj=document.all.mainimg2;
	 }
	 
	else if(document.getElementById)
	 {
		 var obj=document.getElementById('mainimg2');
	 }
	 
	obj.src=source;
}



  var selectedDetailTabName;
  function changeDetailPageTab(tabName) 
  {
    for (var i in tabArray) {
      var tabObj = tabArray[i];
      if (tabObj == null)
        continue;
      // set the tab image to 'on' or 'off'
      var tab = document.getElementById('tab_' + tabObj.name);
      if (tab != null){
        tab.type = "image";
        if (tabObj.name == tabName)
          tab.src = tabObj.onImg;
        else
          tab.src = tabObj.offImg;
      }
      // show this tab, hide all others
      var div = document.getElementById('div_' + tabObj.name);
      if (div != null)
        if (tabObj.name == tabName) 
          div.style.display = "block";
        else
          div.style.display = "none";
      // Turn the accessibility images off.
       var div2 = document.getElementById('access_' + tabObj.name);
       if (div2 != null) 
          div2.style.display = "none";
    } // foreach tab
    // remeber which tab is selected
    selectedDetailTabName = tabName;
    // hide or display the "see more info" link
  }



function openDetailTabPopup(url) {
window_handle = window.open(url,'ProductDetail',"location=0,menubar=0,resizable=no,height=550,width=600,scrollbars=yes,left=220,screenX=220,top=70,screenY=70");
    if( window_handle ){
        window_handle.focus();
    }
  }


/***********************************************************************************************/
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
/********************************************************************************************************/
