//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 * @package Starweb Webshop System
 * @version See version-file
 * @copyright Copyright (c) 2000 - 2010, Ehandelslogik AB
 * 
 * @author Ehandelslogik AB, org.no 556696-9019  (Starweb)
 *  Country: Sweden
 *  Homepage: www.starweb.se
 *  E-mail: support@starweb.se
 * 
 * License:
 * This program is not "free" software and restrictions apply!
 * This file as well as all other files containing the code to our software may ONLY be used and/or redistributed with written permission from us.
 * You'll find information regarding our conditions and pricing on our homepage. Contact us immediately if any of these conditions are not clear.
 */
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$(document).ready(function()
{
   // Get: Width / height of browser window
   var iWndWidthNr = $(window).width();
   var iWndHeightNr = $(window).height();
   
   iWndWidthNr  = Math.round(iWndWidthNr * 0.8);
   iWndHeightNr = Math.round(iWndHeightNr * 0.8);
   
   
   
   // Set: Fancybox settings, based on rel
   $("a[rel*=Fancybox_]").livequery(function(e){
      $(this).fancybox({
         "imageScale"         : true,
         "centerOnScroll"     : false,
         "opacity"            : true,
         "overlayShow"        : true,
         "width"              : 620,
         "height"             : 520,
         "hideOnContentClick" : false,
         "zoomSpeedIn"        : 0,
         "zoomSpeedOut"       : 0,
         "zoomSpeedChange"    : 100
      });
   });
   $("a[rel=Fancybox_CustNewCustInsert]").livequery(function(e){
      $(this).fancybox({
         "centerOnScroll"     : false,
         "opacity"            : true,
         "overlayShow"        : true,
         "width"              : 550,
         "height"             : 435,
         "hideOnContentClick" : false
      });
   });
   $("a[rel=Fancybox_CustAlreadyCust]").livequery(function(e){
      $(this).fancybox({
         "centerOnScroll"     : false,
         "opacity"            : true,
         "overlayShow"        : true,
         "height"             : (bIsADMIN_IS_LOADED == true) ? 500 : 400,
         "hideOnContentClick" : false,
         "autoDimensions"     : false,
         "width"              : 600
      });
   });
   $("a[rel=Fancybox_CustLostPwd]").livequery(function(e){
      $(this).fancybox({
         "centerOnScroll"     : false,
         "opacity"            : true,
         "overlayShow"        : true,
         "width"              : 550,
         "height"             : 200,
         "hideOnContentClick" : false
      });
   });
   $("a[rel=Fancybox_Ac_ArtTellFriend]").livequery(function(e){
      $(this).fancybox({
         "centerOnScroll"     : false,
         "opacity"            : true,
         "overlayShow"        : true,
         "width"              : 550,
         "height"             : 500,
         "hideOnContentClick" : false
      });
   });
   $("a[rel=Fancybox_TplPreview]").livequery(function(e){
      $(this).fancybox({
         "centerOnScroll"     : false,
         "opacity"            : false,
         "overlayShow"        : true,
         "width"              : iWndWidthNr,
         "height"             : iWndHeightNr,
         "hideOnContentClick" : false,
         "onComplete"         : function() { $('.cssPageMsg').hide(); }
      });
   });   
   $("a#cssElibEBookTeaserLink").fancybox({
      'transitionIn'    : 'elastic',
      'transitionOut'	: 'elastic',
      'type'				: 'iframe',
      'width'           : 760,
      'height'          : 620,
      'margin'          : 0,
      'padding'         : 0
   });
   $("a#cssElibAudioBookTeaserLink").fancybox({
      'transitionIn'    : 'elastic',
      'transitionOut'	: 'elastic',
      'type'            : 'ajax'
   });
   
   
});
