function prepareImages(imgs, toId, width, height){
        
    imgs.each(function(img){
        img.addEvent('mouseenter', function(){showZoomEffect(img,'#ff0000')});
        img.addEvent('mouseleave', function(){showZoomEffect(img,'#e3e2e2')});
        img.addEvent('click', function(){showZoomImg(img,toId,width,height)});        
    });
    
    
}

function showZoomImg(img,toId,width,height){   
     
     //Getting the Src
     var newsrc = img.get('src');
     var parts = newsrc.split("&");
          
     if(img.hasClass('zoommainpic')){
        if($('prod360video')) $('prod360video').setStyle('display','none');
        if($('proddetailvideo')) $('proddetailvideo').setStyle('display','block');
     }
     if(img.hasClass('zoom360')){
         if($('proddetailvideo')) $('proddetailvideo').setStyle('display','none');
         if($('prod360video')) $('prod360video').setStyle('display','block');         
     }
     
     if(!img.hasClass('zoom360') && !img.hasClass('zoommainpic')){    
         if($('prod360video')) $('prod360video').setStyle('display','none');
         if($('proddetailvideo')) $('proddetailvideo').setStyle('display','none');         
     }
     
     var myFx = new Fx.Tween(toId);        
     myFx.cancel();
     toId.set('src',parts[0]+'&height='+height);
     myFx.start('opacity',0,1);
     
     
        
}

function showZoomEffect(img,to){    
    var container = img.getParent();
    
    var myFx = new Fx.Tween(container);
    myFx.cancel();
    myFx.start('border-color',container.getStyle('border-color'),to);    
}