var activeDiv = 'd1'; 
var activeTab = 't1';
// Anything in here gets executed when the product page loads
onloads = function(){
  defaultTab();
  popImage();
 // textPop();
}



//START PROTOTYPE CODE

// make the active product content tab selected
defaultTab = function(){
  var a = document.getElementById(activeTab);
  if(a){
   a.style.background='#cccccc';
   if(! document.getElementById(activeTab)) return;
   //Oct 15, 2009 //new Effect.Highlight(activeTab,{startcolor:'#0096e0',endcolor:'#cccccc',restorecolor:'cccccc'});
  }
}
popImage = function(){
  //new Effect.Shake('productMainImage',{duration: .3, distance:3});
}
textPop = function(){
  //Oct 15, 2009
  //new Effect.Highlight('productName',{startcolor:'#0096e0',endcolor:'#ffffff',restorecolor:'ffffff',duration:'2'});
}
showTab = function(thing){ //switch content on the tabs
   var id = thing.id;
   var div = thing.getAttribute('div');
   if(activeDiv != div){
      /*  Oct 15, 2009
        new Effect.Highlight(id,{startcolor:'#0096e0',endcolor:'#cccccc',restorecolor:'cccccc'});
      new Effect.Morph(activeTab,{style:'color:#565656;background:#eeeeee;',duration:.7});
       new Effect.Morph(id,{style:'color:#fff;background:#cccccc;',duration:.7});
      new Effect.Highlight(id,{startcolor:'#0096e0',endcolor:'#cccccc',restorecolor:'cccccc'});
      new Effect.DropOut(activeDiv,{duration: .6});
      new Effect.SlideDown(div,{duration: .4});
      new Effect.BlindUp(activeDiv,{duration: .3});
      */
      //alert('hiding ' + activeDiv);
      document.getElementById(activeDiv).style.display='none';
      //alert('showing ' + div);
      document.getElementById(div).style.display='block';
      
      //alert('EEEEEE to ' + activeTab);
      document.getElementById(activeTab).style.backgroundColor='';
      //alert('CCCCCC to ' + id);
      document.getElementById(id).style.backgroundColor='#CCCCCC';
      
      
      activeDiv = div;
      activeTab = id;
   }
}
hoverTab = function(thing){
    var id = thing.id;
    if(id != activeTab){
      
      /* Oct 15, 2009
      new Effect.Highlight(id,{startcolor:'#0096e0',endcolor:'#eeeeee',restorecolor:'#eeeeee',duration:'.7'});
      new Effect.Highlight(id,{startcolor:'#0096e0',endcolor:'#eeeeee',restorecolor:'#eeeeee',duration:'.7'});
      */
    } 
}


function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=675,left = 200,top = 200');");
}
function whyBuyMore(){
  // Oct 15, 2009
  //Effect.toggle('whyBuyPop','appear');
  disp = document.getElementById('whyBuyPop').style.display;
  var newDisp = 'none';
  if(disp == newDisp){
    newDisp = 'block';
  }
  document.getElementById('whyBuyPop').style.display=newDisp;
  
}
function selectShipping(){

}
function showShipPop(){
  //Oct 15, 2009
  //Effect.toggle('shipPop','appear');
  document.getElementById('shipPop').style.display=block;
}

//END PROTOTYPE ON



/*
//START MOOTOOLS ON

// make the active product content tab selected
defaultTab = function(){
   //document.getElementById(activeTab).style.background='#cccccc';
   if(! document.getElementById(activeTab)) return;
}
popImage = function(){
  //new Effect.Shake('productMainImage',{duration: .3, distance:3});
}
textPop = function(){
  //new Effect.Highlight('productName',{startcolor:'#0096e0',endcolor:'#ffffff',restorecolor:'ffffff',duration:'2'});
}
showTab = function(thing){ //switch content on the tabs
   var id = thing.id;
   var div = thing.getAttribute('div');
   
   if(activeDiv != div){
      
      // for mootools
      var collapsible = new Fx.Slide($(div), {
        duration: 500,
        transition: Fx.Transitions.linear
      });
      
      //collapsible.toggle();    
      
      var newSlide = new Fx.Slide(div);
      $(id).addEvent('click', function(e){
        e = new Event(e);
        newSlide.toggle();
        e.stop();
      });
      
      var oldSlide = new Fx.Slide(activeDiv);
      $(activeTab).addEvent('click', function(e){
        e = new Event(e);
        oldSlide.toggle();
        e.stop();
      });
      
      activeDiv = div;
      activeTab = id;
   }
}

hoverTab = function(thing){
    var id = thing.id;
    if(id != activeTab){
      //new Effect.Highlight(id,{startcolor:'#0096e0',endcolor:'#eeeeee',restorecolor:'#eeeeee',duration:'.7'});
      //new Effect.Highlight(id,{startcolor:'#0096e0',endcolor:'#eeeeee',restorecolor:'#eeeeee',duration:'.7'});
      // for Mootools
      var myEffect = new Fx.Tween(id);
      // We change the background-color of the element
       myEffect.start('background-color', '#0096e0');
    } 
}
/*
$(id).addEvent('mouseout', function(e) {
       // myEffect.start('background-color', '#EEEEEE');
      });




function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=675,left = 200,top = 200');");
}
function whyBuyMore(){
  Effect.toggle('whyBuyPop','appear');
}
function selectShipping(){

}
function showShipPop(){
  Effect.toggle('shipPop','appear');
}

//end mootools ON
*/
