﻿function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function CategoryJump(id)
{
    var list = document.getElementById(id)
    var index = list.selectedIndex;
    if(index > 0)
	    window.location=list.options[index].value;
}

function toggleTabs(tabImageOn, tabImageOff, activeTab, whichLayers)
{

    if(activeTab)
    {
        var elem, vis;  
        if( document.getElementById ) // this is the way the standards work    
            elem = document.getElementById( activeTab );  
        else if( document.all ) // this is the way old msie versions work      
            elem = document.all[activeTab];  
        else if( document.layers ) // this is the way nn4 works    
            elem = document.layers[activeTab];  
        vis = elem.style;  // if the style.display value is blank we try to figure it out here  
        if(vis.display=='inline')    
            return;
            
            if(tabImageOn && tabImageOff)
            {
                var tabOn, tabOff;  
                if( document.getElementById ) // this is the way the standards work    
                    tabOn = document.getElementById( tabImageOn );  
                else if( document.all ) // this is the way old msie versions work      
                    tabOn = document.all[tabImageOn];  
                else if( document.layers ) // this is the way nn4 works    
                    tabOn = document.layers[tabImageOn];  
                if( document.getElementById ) // this is the way the standards work    
                    tabOff = document.getElementById( tabImageOff );  
                else if( document.all ) // this is the way old msie versions work      
                    tabOff = document.all[tabImageOff];  
                else if( document.layers ) // this is the way nn4 works    
                    tabOff = document.layers[tabImageOff];  
                    
                tabOn.src = tabOn.src.replace('off.', 'on.');
                tabOff.src = tabOff.src.replace('on.', 'off.');
                    
            }
    }
    
    if(whichLayers)
    {
    
        for(i = 0 ; i < whichLayers.length; i++)
        {
            if(activeTab == whichLayers[i])
                setLayerVisibility(whichLayers[i], 'block');
            else
                setLayerVisibility(whichLayers[i],'none');
        }
    }
    return false;
}
function setLayerVisibility( whichLayer,display )
{  
    if(whichLayer)
    {
        var elem, vis;  
        if( document.getElementById ) // this is the way the standards work    
            elem = document.getElementById( whichLayer );  
        else if( document.all ) // this is the way old msie versions work      
            elem = document.all[whichLayer];  
        else if( document.layers ) // this is the way nn4 works    
            elem = document.layers[whichLayer];  
        vis = elem.style;  // if the style.display value is blank we try to figure it out here  
          
        vis.display =display;
    }
}

function toggleLayers( whichLayers, display)
{
    if(!display)
        display = 'block';
        
    if(whichLayers)
    {
    
        for(i = 0 ; i < whichLayers.length; i++)
        {
            toggleLayer(whichLayers[i],display);
        }
    }
    return false;
}
function toggleLayer( whichLayer,display )
{  
    if(!display)
        display = 'block';
        
    if(whichLayer)
    {
        var elem, vis;  
        if( document.getElementById ) // this is the way the standards work    
            elem = document.getElementById( whichLayer );  
        else if( document.all ) // this is the way old msie versions work      
            elem = document.all[whichLayer];  
        else if( document.layers ) // this is the way nn4 works    
            elem = document.layers[whichLayer];  
        vis = elem.style;  // if the style.display value is blank we try to figure it out here  
        if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
            vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?display:'none';  
            
        vis.display = (vis.display==''||vis.display==display)?'none':display;
    }
}

function ShowHideElement(id)
{
    var obj = document.getElementById(id);
    if (obj.style.display == "none")
        obj.style.display = "inline";
    else
        obj.style.display = "none";
    
}

function getPos(el,sProp) {
	var iPos = 0;
	if (el.offsetParent)
	{//ie
		while (el!=null) {
		    iPos+=el["offset" + sProp];
		    el = el.offsetParent;
		    if (!el.offsetParent)
		    {
		        break;
		    }
		}
	}
	else if (el.y)
	{//firefox
	    if (sProp == 'Left')
	        iPos = el.x;
	    else
	        iPos = el.y;
	}
		    
	return iPos;

}


function OpenWindow(url)
{
    var ParentwinW = 800, ParentwinH = 600;
    var ParentwinTop = 0, ParentwinLeft = 0;
    var winW = 800, winH = 600;
    var winTop = 0, winLeft = 0;
    
    if (parseInt(navigator.appVersion)>3) {
     if (navigator.appName=="Netscape") {
      ParentwinW = window.innerWidth;
      ParentwinH = window.innerHeight;
      ParentwinLeft = window.screenX;
      ParentwinTop = window.screenY;
      winW = ParentwinW * 70/100;
      winH = ParentwinH * 70/100;
      winTop = ParentwinTop + ((ParentwinH - winH) / 2) + 50;
      winLeft = ParentwinLeft + ((ParentwinW - winW) / 2) - 10;
     }
     if (navigator.appName.indexOf("Microsoft")!=-1) {
      ParentwinW = document.documentElement.clientWidth;
      ParentwinH = document.documentElement.clientHeight;
      ParentwinLeft = window.screenLeft;
      ParentwinTop = window.screenTop;
      winW = ParentwinW * 70/100;
      winH = ParentwinH * 70/100;
      winTop = ParentwinTop + ((ParentwinH - winH) / 2) - 100;
      winLeft = ParentwinLeft + ((ParentwinW - winW) / 2) - 10;
      
     }
    }
    window.open(url,'','left=' + winLeft + ', top=' + winTop + ',width=' + winW + ',height=' + winH + ',resizable=1, menubar=1, location=1,scrollbars=1');
}

function RedirectTo(url)
{
    window.document.location = url;
}

function variations_move_right(variation_total_count)
{
    variation_end++;           
    if (variation_end >= variation_total_count)         
        variation_end = variation_total_count - 1;           
    else            
        variation_begin++;           
                    
    reset_variations(variation_total_count);     
}

function variations_move_left(variation_total_count)
{       
    variation_begin--;
    if (variation_begin < 0)          
        variation_begin = 0;         
    else                       
        variation_end--;         
        
    reset_variations(variation_total_count);          
}

function reset_variations(variation_total_count)
{   
    //variations left arrow
    if (variation_begin > 0)       
        document.getElementById("img_variation_left").style.display = "inline";        
    else
        document.getElementById("img_variation_left").style.display = "none";    
        
    //variations
    for (i = 0; i < variation_begin; i++)
    {
        img = "idVariation_" + i;
        document.getElementById(img).style.display = "none";            
    }                
    for (i = variation_begin; i <= variation_end; i++)
    {
        img = "idVariation_" + i;
        document.getElementById(img).style.display = "inline";            
    }          
    for (i = (variation_end+1); i < variation_total_count; i++)
    {
        img = "idVariation_" + i;
        document.getElementById(img).style.display = "none";            
    }          
    
    //variations right arrow
    if (variation_end <= (variation_total_count - 2) )        
        document.getElementById("img_variation_right").style.display = "inline";
    else
        document.getElementById("img_variation_right").style.display = "none";
            
}
function hidestatus(statusmsg)
{
window.status=statusmsg
return true
}
function statusClear()
{
       window.status=''
       return true
    }
function statusClick()
{
       window.status='Loading'
       return true
}
function validateEmail(addr,man,db) 
{
//alert(addr);
//    if (addr == '' && man) {
//       if (db) alert('email address is mandatory');
//       return false;
//    }
    if (addr == '') return true;
    var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
    for (i=0; i<invalidChars.length; i++) {
       if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
          if (db) 
          alert('email address contains invalid characters');
          return false;
       }
    }
    for (i=0; i<addr.length; i++) {
       if (addr.charCodeAt(i)>127) {
          if (db) 
          alert("email address contains non ascii characters.");
          return false;
       }
    }

    var atPos = addr.indexOf('@',0);
    if (atPos == -1) {
       if (db) 
       alert('email address must contain an @');
       return false;
    }
    if (atPos == 0) {
       if (db) 
       alert('email address must not start with @');
       return false;
    }
    if (addr.indexOf('@', atPos + 1) > - 1) {
       if (db) 
       alert('email address must contain only one @');
       return false;
    }
    if (addr.indexOf('.', atPos) == -1) {
       if (db) 
       alert('email address must contain a period in the domain name');
       return false;
    }
    if (addr.indexOf('@.',0) != -1) {
       if (db) 
       alert('period must not immediately follow @ in email address');
       return false;
    }
    if (addr.indexOf('.@',0) != -1){
       if (db) 
       alert('period must not immediately precede @ in email address');
       return false;
    }
    if (addr.indexOf('..',0) != -1) {
       if (db) 
       alert('two periods must not be adjacent in email address');
       return false;
    }
    var suffix = addr.substring(addr.lastIndexOf('.')+1);
    if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
       if (db) 
       alert('invalid primary domain in email address');
       return false;
    }
    return true;
}
////Product List product compare
var count;
count=0;
var QueryString="";
function ChecklistCount(passvalue,Name)
{
var c=count;
  checkExsitingChecklist(Name);
  var id=document.getElementById('IFrame1').contentWindow.document.getElementById(passvalue)
  
  if (id.checked==true)
  {
    
    if(count>=0 && c==count)
    count+=1;
    if(count>6)
  {
  
  id.checked=false;
  alert("the max number of products is 6!")
  return;
  }
     if(QueryString=="")
     {
          QueryString=id.value;
     }
     else
     {
          if(QueryString.indexOf(id.value)==-1)
             QueryString=QueryString+","+id.value;
     }
  }
  else
  {
    count-=1;
    
     if(QueryString.indexOf(id.value+",")>-1)
     {
          QueryString = remove(QueryString, id.value+",")
     }
     else if(QueryString.indexOf(","+id.value)>-1)
     {
         
         QueryString = remove(QueryString, ","+id.value)
         // alert(QueryString)
          
     }
      else if(QueryString.indexOf(id.value)>-1)
     {
         
         QueryString = remove(QueryString, id.value)
         // alert(QueryString)
          
     }
  //  alert(QueryString)
  
  }
 
    
}

function remove(s, t) {
  
  i = s.indexOf(t);
  r = "";
  if (i == -1) return s;
  r += s.substring(0,i) + remove(s.substring(i + t.length), t);
  return r;
  }
function ProductCompare(Name,ProductComparisonURL)
{
checkExsitingChecklist(Name);
   


      
   if( QueryString.indexOf(",")==-1)
   {
         alert("Please select at least 2 products for comparing!")
       return;
   }
   else if (QueryString =="")
   {
        
   
          
      if(QueryString=="")
           alert("Please select at least 2 products for comparing!")
      else
           window.location.href= ProductComparisonURL+"&CategoryIDList="+QueryString;
   }
   else
   {
    window.location.href= ProductComparisonURL+"&CategoryIDList="+QueryString;
  }
}
function checkExsitingChecklist(Name)
{
       var pp =  document.getElementById('IFrame1').contentWindow.document.getElementsByName(Name);

        
         for (counter = 0; counter < pp.length; counter++)
         {
                  
               if (pp[counter].checked)
               {
                     if(QueryString.indexOf(pp[counter].value)==-1)
                     {
                      count+=1;    
                         if(QueryString=="")
                         {
                         QueryString=pp[counter].value;
                         }
                         else
                         {
                        
                           QueryString=QueryString+","+pp[counter].value;
                          }
                      }
                }
              
                
          }
}
/////Brand listing Compare

//////product compare
var count;
count=0;
function BLChecklistCount(passvalue)
{
  var id=document.getElementById(passvalue)
  
  if (id.checked==true)
  {
    if(count>=0)
    count+=1;
    
  }
  else
  {
  count-=1;
  
  }
 // alert(count)
  if(count>6)
  {
  
  id.checked=false;
  alert("the max number of products is 6!")
  
  }
  
    
}
function BLProductCompare(Name,ProductComparisonURL)
{

   
var pp =  document.getElementsByName(Name);

var QueryString="";
// if(pp.type=='checkbox')
//  {

    
     for (counter = 0; counter < pp.length; counter++)
     {
              
           if (pp[counter].checked)
           {
               
                      
                 if(QueryString=="")
                 {
                 QueryString=pp[counter].value;
                 }
                 else
                 {
                
                   QueryString=QueryString+","+pp[counter].value;
                  }
            }
          
            
      }
      
     if( QueryString.indexOf(",")==-1)
     {
         alert("Please select at least 2 products for comparing!")
       return;
   }

   if (QueryString =="")
   {
      alert("Please select at least 2 products for comparing!")
      
   }
   else
   {
    parent.window.location.href= ProductComparisonURL+"&CategoryIDList="+QueryString;
  }
}
function BLCheckboxChecked(id)
{

  if(document.getElementById(id).type=='checkbox')
  {
    if(document.getElementById(id).checked==true)
    {
        document.getElementById(id).checked=false;
    }
    else
    {
        document.getElementById(id).checked=true;
    }
    BLChecklistCount(id)
    
  }
}
////////////////////////

function toggleTabs1(tabImageOn, tabImageOff1,tabImageOff2, activeTab, whichLayers)
{

    if(activeTab)
    {
        var elem, vis;  
        if( document.getElementById ) // this is the way the standards work    
            elem = document.getElementById( activeTab );  
        else if( document.all ) // this is the way old msie versions work      
            elem = document.all[activeTab];  
        else if( document.layers ) // this is the way nn4 works    
            elem = document.layers[activeTab];  
        vis = elem.style;  // if the style.display value is blank we try to figure it out here  
        if(vis.display=='inline')    
            return;
            
            if(tabImageOn && tabImageOff1 && tabImageOff2 )
            {
                var tabOn, tabOff1,tabOff2;  
                if( document.getElementById ) // this is the way the standards work    
                    tabOn = document.getElementById( tabImageOn );  
                else if( document.all ) // this is the way old msie versions work      
                    tabOn = document.all[tabImageOn];  
                else if( document.layers ) // this is the way nn4 works    
                    tabOn = document.layers[tabImageOn];  
                if( document.getElementById ) // this is the way the standards work    
                {
                    tabOff1 = document.getElementById( tabImageOff1 );  
                    tabOff2 = document.getElementById( tabImageOff2 ); 
                    // tabOff3 = document.getElementById( tabImageOff3 );  
                }
                else if( document.all ) // this is the way old msie versions work  
                {    
                    tabOff1 = document.all[tabImageOff1];  
                     tabOff2 = document.all[tabImageOff2]; 
                     // tabOff3 = document.all[tabImageOff3];  
                }
                else if( document.layers ) // this is the way nn4 works    
                {
                    tabOff1 = document.layers[tabImageOff1]; 
                    tabOff2 = document.layers[tabImageOff2];
                      //  tabOff3 = document.layers[tabImageOff3]; 
               }     
                tabOn.src = tabOn.src.replace('off.', 'on.');
                tabOff1.src = tabOff1.src.replace('on.', 'off.');
                tabOff2.src = tabOff2.src.replace('on.', 'off.');
                // tabOff3.src = tabOff3.src.replace('on.', 'off.');
            }
    }
    
    if(whichLayers)
    {
    
        for(i = 0 ; i < whichLayers.length; i++)
        {
            toggleLayer1(whichLayers[i],activeTab);
        }
    }
    return false;
}

function toggleLayer1( whichLayer,activeTab )
{  
    if(whichLayer)
    {
        var elem, vis;  
        if( document.getElementById ) // this is the way the standards work    
            elem = document.getElementById( whichLayer );  
        else if( document.all ) // this is the way old msie versions work      
            elem = document.all[whichLayer];  
        else if( document.layers ) // this is the way nn4 works    
            elem = document.layers[whichLayer];  
        vis = elem.style;  // if the style.display value is blank we try to figure it out here  
        if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
            vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'inline':'none';  
        if(whichLayer==activeTab)
            vis.display = 'inline';
        else
            vis.display ='none';
        //vis.display = (vis.display==''||vis.display=='inline')?'none':'inline';
      
    }
}

function removeHTMLTags(elm){
 	if(document.getElementById && document.getElementById(elm)){
 		var strInput = document.getElementById(elm);
 		
 	 	strInput.vaule = strInput.value.replace(/&(lt|gt);/g, function (strMatch, p1){
 		 	return (p1 == "lt")? "<" : ">";
 		});
 		var strTagStrippedText = strInput.value.replace(/<\/?[^>]+(>|$)/g, "");
 		
 		strInput.value = strTagStrippedText;
  }	
}
/////////////////////////////////////////////////////
 var count;
var NumberOfBlock;
var C_HeightByOneRound;
var OneBlockByTime;

function runShowHide(index,pNewsExpand,LastDiv,pNewsHidden,type,HeightByOneRound,BlockByTime,pNewsExpandAlign,displaytype)
{
  //alert("hihi");
  C_HeightByOneRound=HeightByOneRound;
  OneBlockByTime=BlockByTime;
  count=0;
  var ContentID = "ShowHide" + index + "Content";
  NumberOfBlock=LastDiv*OneBlockByTime;
  setTimeout("Sliding(" + NumberOfBlock + ",'" + ContentID + "','" + pNewsExpand + "','" + LastDiv +  "','" +  pNewsHidden+"','" +  type+"','" +  pNewsExpandAlign+"','" +  displaytype+"')", 33);
 
}

function Sliding(NumberOfBlockLeft, ContentID, pNewsExpand,LastDiv,pNewsHidden,type,pNewsExpandAlign,displaytype)
{  
   
    count+=1
  var curTick = LastDiv;
  var elapsed =1;
  
  var Content = (ContentID == '') ? null : document.getElementById(ContentID);
  var MenuExpandID=document.getElementById(pNewsExpand);
  var MenuHiddenID=document.getElementById(pNewsHidden);
  if(Content==null)
    return;
  
//  if(type=='show')
//    MenuExpandID.style.display = 'none';
//  else
//    MenuHiddenID.style.display = 'none';
  // alert(ContentID+",count"+count+"NumberOfBlockLeft"+NumberOfBlockLeft)
  // alert(NumberOfBlockLeft)
  if(NumberOfBlockLeft <= 0)
  {
      if(type=='show')
      { 

            
          Content.style.height = (C_HeightByOneRound*OneBlockByTime*LastDiv+3) + 'px';
          if(MenuExpandID.id.indexOf('divCollection')>-1)
            MenuExpandID.style.display = 'inline';
          else
            MenuExpandID.style.display = 'none';
          MenuHiddenID.style.display = 'inline';
          
       } 
       else
        {
          //MenuExpandID.style.textAlign= pNewsExpandAlign;
          MenuExpandID.style.display = 'inline';
          Content.style.display = 'none';
          Content.style.height = '0px';
          MenuHiddenID.style.display = 'none';
        }
        return;
  }

  NumberOfBlockLeft -= elapsed;
  var newhiddenHeight =C_HeightByOneRound*count ;
  var divDotID=document.getElementById('divDot');
  if(type=='show')
  {
    if(navigator.userAgent.indexOf('Firefox')>-1)
   {
      
      Content.style.overflow='hidden';
    }
//   if(count==1 && displaytype=='inline')
//       Content.style.display = 'inline';
   if(Content.style.display != displaytype)
      Content.style.display = displaytype;
    Content.style.height = newhiddenHeight + 'px';
  
   if(divDotID!=null)
    divDotID.style.height =400+ newhiddenHeight + 'px';
  }
  else
  {
    Content.style.height = Math.round(((C_HeightByOneRound*OneBlockByTime)*LastDiv)-(C_HeightByOneRound*count))>=0? Math.round(((C_HeightByOneRound*OneBlockByTime)*LastDiv)-(C_HeightByOneRound*count))+ 'px':0+"px";
    if(divDotID!=null)
       divDotID.style.height =400+ Math.round(((C_HeightByOneRound*OneBlockByTime)*LastDiv)-(C_HeightByOneRound*count)) + 'px';
  }
      setTimeout("Sliding("  + NumberOfBlockLeft +",'" + ContentID + "','" + pNewsExpand + "','" + LastDiv +  "','" +  pNewsHidden+"','" +  type+"','" +  pNewsExpandAlign+"','" +  displaytype+"')", 33);
}

function runShowHide2ForStyle(index,pNewsExpand,LastDiv,pNewsHidden,type,HeightByOneRound,BlockByTime,pNewsExpandAlign,displaytype)
{


   setTimeout("runShowHide('"  +6 +"','" +pNewsExpand +"','" +3+"','" +pNewsHidden +"','" +type +"','" +HeightByOneRound +"','" +BlockByTime +"','" +pNewsExpandAlign +"','" +displaytype+"')",0);

   setTimeout("runShowHide('"  +7 +"','" +pNewsExpand +"','" +3 +"','" +pNewsHidden +"','" +type +"','" +HeightByOneRound +"','" +BlockByTime +"','" +pNewsExpandAlign +"','" +displaytype+"')",236);

   setTimeout("runShowHide('"  +8 +"','" +pNewsExpand +"','" +3 +"','" +pNewsHidden +"','" +type +"','" +HeightByOneRound +"','" +BlockByTime +"','" +pNewsExpandAlign +"','" +displaytype+"')",336);
 

}
////////////////////////////////
function toggleTabs2(tabImageOn, tabImageOff1,tabImageOff2,tabImageOff3, activeTab, whichLayers)
{

    if(activeTab)
    {
        var elem, vis;  
        if( document.getElementById ) // this is the way the standards work    
            elem = document.getElementById( activeTab );  
        else if( document.all ) // this is the way old msie versions work      
            elem = document.all[activeTab];  
        else if( document.layers ) // this is the way nn4 works    
            elem = document.layers[activeTab];  
        vis = elem.style;  // if the style.display value is blank we try to figure it out here  
        if(vis.display=='inline')    
            return;
            
            if(tabImageOn && tabImageOff1 && tabImageOff2 && tabImageOff3)
            {
                var tabOn, tabOff1,tabOff2,tabOff3;  
                if( document.getElementById ) // this is the way the standards work    
                    tabOn = document.getElementById( tabImageOn );  
                else if( document.all ) // this is the way old msie versions work      
                    tabOn = document.all[tabImageOn];  
                else if( document.layers ) // this is the way nn4 works    
                    tabOn = document.layers[tabImageOn];  
                if( document.getElementById ) // this is the way the standards work    
                {
                    tabOff1 = document.getElementById( tabImageOff1 );  
                    tabOff2 = document.getElementById( tabImageOff2 ); 
                     tabOff3 = document.getElementById( tabImageOff3 );  
                }
                else if( document.all ) // this is the way old msie versions work  
                {    
                    tabOff1 = document.all[tabImageOff1];  
                     tabOff2 = document.all[tabImageOff2]; 
                      tabOff3 = document.all[tabImageOff3];  
                }
                else if( document.layers ) // this is the way nn4 works    
                {
                    tabOff1 = document.layers[tabImageOff1]; 
                    tabOff2 = document.layers[tabImageOff2];
                        tabOff3 = document.layers[tabImageOff3]; 
               }     
                tabOn.src = tabOn.src.replace('off.', 'on.');
                tabOff1.src = tabOff1.src.replace('on.', 'off.');
                tabOff2.src = tabOff2.src.replace('on.', 'off.');
                 tabOff3.src = tabOff3.src.replace('on.', 'off.');
            }
    }
    
    if(whichLayers)
    {
    
        for(i = 0 ; i < whichLayers.length; i++)
        {
            toggleLayer1(whichLayers[i],activeTab);
        }
    }
    return false;
}

function toggleLayer2( whichLayer,activeTab )
{  
    if(whichLayer)
    {
        var elem, vis;  
        if( document.getElementById ) // this is the way the standards work    
            elem = document.getElementById( whichLayer );  
        else if( document.all ) // this is the way old msie versions work      
            elem = document.all[whichLayer];  
        else if( document.layers ) // this is the way nn4 works    
            elem = document.layers[whichLayer];  
        vis = elem.style;  // if the style.display value is blank we try to figure it out here  
        if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
            vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'inline':'none';  
        if(whichLayer==activeTab)
            vis.display = 'inline';
        else
            vis.display ='none';
        //vis.display = (vis.display==''||vis.display=='inline')?'none':'inline';
      
    }
}


/////////////////////////////////////////////////////