
$(document).ready(function() {

$.cookieBar({
    // declineButton: true
	policyButton: true,
	policyURL: 'SH_Policy.php'
	//append: true
}); 

// Fancybox images...

			$("a#example1").fancybox();

			$("a#example2").fancybox({
				'overlayShow'	: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
			});

			$("a.example3").fancybox({
				'transitionIn'	: 'none',
				'transitionOut'	: 'none'	
			});

			$("a.photo").fancybox({
				'opacity'		 		: true,
				'overlayShow'	  : true,
		    'speedIn'		    : 1500,
		    'speedOut'		  : 1000,
		    'transitionIn'	: 'fade',
		    'transitionOut'	: 'elastic',
		    'titlePosition'	: 'over',
				'type'          : 'image'
			});

			$("a#example5").fancybox();

			$("a#example6").fancybox({
				'titlePosition'		: 'outside',
				'overlayColor'		: '#000',
				'overlayOpacity'	: 0.9
			});

			$("a#example7").fancybox({
				'titlePosition'	: 'inside'
			});

			$("a#example8").fancybox({
				'titlePosition'	: 'over'
			});

			$("a[rel=group]").fancybox({
			  'cyclic'    		:true,
				'padding'       :    3,
		    'speedIn'		    : 1500,
		    'speedOut'		  : 1000,
		    'transitionIn'	: 'elastic',
		    'transitionOut'	: 'fade',
//				'transitionIn'	: 'none',
//				'transitionOut'	: 'none',
				'titlePosition' : 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">' + (title.length ? '' + title : '') + '</span>';
				//return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});

// Older version displays...
	
	$("a#form").bind("click", function() {
		$("#form").submit()
	});

	$("a#single_1").fancybox();
		
	$("a#single_2").fancybox({
		'zoomOpacity'		: true,
		'overlayShow'		: false,
		'speedIn'			  : 500,
		'speedOut'		  : 500
	});

	$("a#single_3").fancybox({
		'overlayShow'		: false,
		'speedIn'			  : 600,
		'speedOut'		  : 500,
		'easingIn'			: 'easeOutBack',
		'easingOut'			: 'easeInBack'
	});
	
	$(".map").fancybox({
		'speedIn'		    : 1000,
		'speedOut'		  : 1000,
		'width'			    :	640,
		'height'			  :	660,		
		'autoScale'			: false,
		'padding'			  : 0,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'type'				  : 'iframe',
		'hideOnContentClick': false
	});
	
	$(".slides").fancybox({
		'width'			    :	498,
		'height'			  :	670,
		'speedIn'		    : 2000,
		'speedOut'		  : 2000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'hideOnContentClick': false
	});
		
	$(".soins").fancybox({
		'width'		      :	460,
		'height'		    : 580,
		'speedIn'		    : 1000,
		'speedOut'	    : 2000,
		'autoScale'			: false,
		'padding'			  : 3,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'type'				  : 'iframe',
		'hideOnContentClick': false
	});
			
	$(".news").fancybox({
		'width'			    :	635,
		'height'			  : 438,
		'speedIn'		    : 1000,
		'speedOut'		  : 2000,
		'transitionIn'	: 'elastic',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});

	$(".cheque").fancybox({
		'width'			    :	650,
		'height'			  : 322,
		'speedIn'		    : 1000,
		'speedOut'		  : 2000,
		'padding'			  : 3,
		'titlePosition'	: 'inside',
		'type'				  : 'iframe',
		'hideOnContentClick': false
	});

	$(".video").fancybox({
		'width'			    :	535,
		'height'			  : 335,
		'speedIn'		    : 1000,
		'speedOut'		  : 2000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});

	$(".fredy").fancybox({
		'width'			    : 450,
		'height'			: 500,
		'speedIn'		    : 1000,
		'speedOut'		    : 2000,
		'transitionIn'	    : 'elastic',
		'transitionOut'	    : 'fade',
		'type'				: 'iframe',
		'titlePosition'	    : 'over',
		'padding'			: 3,
		'hideOnContentClick': false
	});


	$(".600x700").fancybox({
		'width'			    : 600,
		'height'			: 700,
		'speedIn'		    : 1000,
		'speedOut'		    : 2000,
		'transitionIn'	    : 'elastic',
		'transitionOut'	    : 'elastic',
		'type'				: 'iframe',
		'titlePosition'	    : 'over',
		'padding'			: 3,
		'hideOnContentClick': false
	});

	$(".600x800").fancybox({
		'width'			    : 600,
		'height'			: 800,
		'speedIn'		    : 1000,
		'speedOut'		    : 2000,
		'transitionIn'	    : 'elastic',
		'transitionOut'	    : 'elastic',
		'type'				: 'iframe',
		'titlePosition'	    : 'over',
		'padding'			: 3,
		'hideOnContentClick': false
	});


	$(".900x500").fancybox({
		'width'			    :	900,
		'height'			  :	500,
		'speedIn'		    : 1000,
		'speedOut'		  : 1000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});	
	
	$(".980x740").fancybox({
		'width'			    :	980,
		'height'			  :	740,
		'speedIn'		    : 1000,
		'speedOut'		  : 1000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});	
	
	$(".1000x760").fancybox({
		'width'			    :	1000,
		'height'			  :	760,
		'speedIn'		    : 1000,
		'speedOut'		  : 1000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});

	$(".1000x800").fancybox({
		'width'			    :	1000,
		'height'			  :	800,
		'speedIn'		    : 1000,
		'speedOut'		  : 1000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});	

	$(".1100x800").fancybox({
		'width'			    :	1100,
		'height'			  :	800,
		'speedIn'		    : 1000,
		'speedOut'		  : 1000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});	
	
	$(".800x800").fancybox({
		'width'			    :	800,
		'height'			  :	800,
		'speedIn'		    : 2000,
		'speedOut'		  : 2000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});
	
	$(".700x500").fancybox({
		'width'			    :	700,
		'height'			  :	500,
		'speedIn'		    : 1000,
		'speedOut'		  : 500,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});	
	
	$(".600x500").fancybox({
		'width'			    :	600,
		'height'			  :	500,
		'speedIn'		    : 2000,
		'speedOut'		  : 2000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});	

	$(".400x500").fancybox({
		'width'	 		    :	400,
		'height'			  :	500,
		'speedIn'		    : 1000,
		'speedOut'		  : 1000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});

	$(".browse").fancybox({
		'width'			: 1080,
		'height'		: 880,
		'speedIn'   	: 1000,
		'speedOut'	    : 1000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'type'			: 'iframe',
		'titlePosition'	: 'outside',
		'padding'		: 3,
		'hideOnContentClick': false
	});	
		
	$(".400x600").fancybox({
		'width'			    :	400,
		'height'			  : 600,
		'speedIn'		    : 1000,
		'speedOut'		  : 2000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});		

	$(".400x400").fancybox({
		'width'		 	    :	400,
		'height'			  : 400,
		'speedIn'		    : 1000,
		'speedOut'		  : 2000,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'				  : 'iframe',
		'titlePosition'	: 'over',
		'padding'			  : 3,
		'hideOnContentClick': false
	});

		$(".840x650").fancybox({
		'width'			: 840,
		'height'		: 650,
		'speedIn'   	: 500,
		'speedOut'	    : 300,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'fade',
		'type'			: 'iframe',
		'titlePosition'	: 'outside',
		'padding'		: 3,
		'hideOnContentClick': false
	});	

	
		$(".sopcast").fancybox({
		'width'			    :	850,
		'height'			  :	730,
		'speedIn'   		: 500,
		'speedOut'	    : 300,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'type'				  : 'iframe',
		'titlePosition'	: 'outside',
		'padding'			  : 3,
		'hideOnContentClick': false
	});	
	
});



	
	
/**
* EasyDrag 1.5 - Drag & Drop jQuery Plug-in
*
* Thanks for the community that is helping the improvement
* of this little piece of code.
*
* For usage instructions please visit http://fromvega.com/scripts
*/

(function($){

        // to track if the mouse button is pressed
        var isMouseDown    = false;

        // to track the current element being dragged
        var currentElement = null;

        // callback holders
        var dropCallbacks = {};
        var dragCallbacks = {};
        
        // bubbling status
        var bubblings = {};

        // global position records
        var lastMouseX;
        var lastMouseY;
        var lastElemTop;
        var lastElemLeft;
        
        // track element dragStatus
        var dragStatus = {};    

        // if user is holding any handle or not
        var holdingHandler = false;

        // returns the mouse (cursor) current position
        $.getMousePosition = function(e){
                var posx = 0;
                var posy = 0;

                if (!e) var e = window.event;

                if (e.pageX || e.pageY) {
                        posx = e.pageX;
                        posy = e.pageY;
                }
                else if (e.clientX || e.clientY) {
                        posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
                        posy = e.clientY + document.body.scrollTop  + document.documentElement.scrollTop;
                }

                return { 'x': posx, 'y': posy };
        };

        // updates the position of the current element being dragged
        $.updatePosition = function(e) {
                var pos = $.getMousePosition(e);

                var spanX = (pos.x - lastMouseX);
                var spanY = (pos.y - lastMouseY);

                $(currentElement).css("top",  (lastElemTop + spanY));
                $(currentElement).css("left", (lastElemLeft + spanX));
        };

        // when the mouse is moved while the mouse button is pressed
        $(document).mousemove(function(e){
                if(isMouseDown && dragStatus[currentElement.id] != 'false'){
                        // update the position and call the registered function
                        $.updatePosition(e);
                        if(dragCallbacks[currentElement.id] != undefined){
                                dragCallbacks[currentElement.id](e, currentElement);
                        }

                        return false;
                }
        });

        // when the mouse button is released
        $(document).mouseup(function(e){
                if(isMouseDown && dragStatus[currentElement.id] != 'false'){
                        isMouseDown = false;
                        if(dropCallbacks[currentElement.id] != undefined){
                                dropCallbacks[currentElement.id](e, currentElement);
                        }

                        return false;
                }
        });

        // register the function to be called while an element is being dragged
        $.fn.ondrag = function(callback){
                return this.each(function(){
                        dragCallbacks[this.id] = callback;
                });
        };

        // register the function to be called when an element is dropped
        $.fn.ondrop = function(callback){
                return this.each(function(){
                        dropCallbacks[this.id] = callback;
                });
        };
        
        // disable the dragging feature for the element
        $.fn.dragOff = function(){
                return this.each(function(){
                        dragStatus[this.id] = 'off';
                });
        };
        
        // enable the dragging feature for the element
        $.fn.dragOn = function(){
                return this.each(function(){
                        dragStatus[this.id] = 'on';
                });
        };
        
        // set a child element as a handler
        $.fn.setHandler = function(handlerId){
                return this.each(function(){
                        var draggable = this;
                        
                        // enable event bubbling so the user can reach the handle
                        bubblings[this.id] = true;
                        
                        // reset cursor style
                        $(draggable).css("cursor", "");
                        
                        // set current drag status
                        dragStatus[draggable.id] = "handler";

                        // change handle cursor type
                        $("#"+handlerId).css("cursor", "pointer");      
                        
                        // bind event handler
                        $("#"+handlerId).mousedown(function(e){
                                holdingHandler = true;
                                $(draggable).trigger('mousedown', e);
                        });
                        
                        // bind event handler
                        $("#"+handlerId).mouseup(function(e){
                                holdingHandler = false;
                        });
                });
        }

        // set an element as draggable - allowBubbling enables/disables event bubbling
        $.fn.easydrag = function(allowBubbling){

                return this.each(function(){

                        // if no id is defined assign a unique one
                        if(undefined == this.id || !this.id.length) this.id = "easydrag"+(new Date().getTime());
                        
                        // save event bubbling status
                        bubblings[this.id] = allowBubbling ? true : false;

                        // set dragStatus 
                        dragStatus[this.id] = "on";
                        
                        // change the mouse pointer
                        $(this).css("cursor", "move");

                        // when an element receives a mouse press
                        $(this).mousedown(function(e){
                                
                                // just when "on" or "handler"
                                if((dragStatus[this.id] == "off") || (dragStatus[this.id] == "handler" && !holdingHandler))
                                        return bubblings[this.id];

                                // set it as absolute positioned
                                $(this).css("position", "absolute");

                                // set z-index
                                $(this).css("z-index", parseInt( new Date().getTime()/1000 ));

                                // update track variables
                                isMouseDown    = true;
                                currentElement = this;

                                // retrieve positioning properties
                                var pos    = $.getMousePosition(e);
                                lastMouseX = pos.x;
                                lastMouseY = pos.y;

                                lastElemTop  = this.offsetTop;
                                lastElemLeft = this.offsetLeft;

                                $.updatePosition(e);

                                return bubblings[this.id];
                        });
                });
        };

})(jQuery);


$(function(){
	$("#fancybox-wrap").easydrag();
});
	


// start em-txtbox.js ...

var IE = document.all?true:false;

if (!IE) 
  document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = getMouseXY;

var tempX = 0;
var tempY = 0;
  
function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
    tempY = e.pageY;
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
			 
  obj_info = document.getElementById("box_info");	
  if (obj_info)
  	{
//    obj_info.style.top = tempY/10 + 'em';
//   	obj_info.style.left = (tempX/10 + 1) + 'em';
		 if (tempY < 80)
       {
			 obj_info.style.left = (tempX/10 - 18) + 'em';
//			 obj_info.style.width = '18em';
			 }
		 else
       {
			 obj_info.style.left = (tempX/10 + 1.5) + 'em';
//			 obj_info.style.width = '3.5em';
			 }
     obj_info.style.top = (tempY/10 + 1.3) + 'em';
  	}
  obj_info = document.getElementById("info");
  if (obj_info)
    {
  	obj_info.style.top = tempY/10 + 'em';
   	obj_info.style.left = (tempX/10 + 1) + 'em';
  	}
  obj_info = document.getElementById("small_info");
  if (obj_info)
		{
    obj_info.style.top = tempY/10 + 'em';
   	obj_info.style.left = (tempX/10 + 1) + 'em';
	  }
		
  obj_info = document.getElementById("large_info");
  if (obj_info)
  	{
    obj_info.style.top = tempY/10 + 'em';
   	obj_info.style.left = (tempX/10 + 1) + 'em';
  	}

  return true;
}

function alert_msg(titletext,bodytext){
  obj_info = document.getElementById("box_info");
  obj_info.style.display = 'block';
  obj_imagetitle = document.getElementById("box_imagetitle");
  obj_imagetitle.innerHTML = titletext;
  obj_imagebody = document.getElementById("box_imagebody");
  obj_imagebody.innerHTML = bodytext;
}

function alert_popup(titletext,bodytext){
  obj_info = document.getElementById("info");
  obj_info.style.display = 'block';
  obj_imagetitle = document.getElementById("imagetitle");
  obj_imagetitle.innerHTML = titletext;
  obj_imagebody = document.getElementById("imagepopup");
  obj_imagebody.innerHTML = bodytext;
}

function alert_popup_small(titletext,bodytext){
  obj_info = document.getElementById("small_info");
  obj_info.style.display = 'block';
  obj_imagetitle = document.getElementById("small_imagetitle");
  obj_imagetitle.innerHTML = titletext;
  obj_imagebody = document.getElementById("small_imagepopup");
  obj_imagebody.innerHTML = bodytext;
}

function alert_popup_large(titletext,bodytext){
  obj_info = document.getElementById("large_info");
  obj_info.style.display = 'block';
  obj_imagetitle = document.getElementById("large_imagetitle");
  obj_imagetitle.innerHTML = titletext;
  obj_imagebody = document.getElementById("large_imagepopup");
  obj_imagebody.innerHTML = bodytext;
}

function away()
{
obj_info = document.getElementById("info");
if (obj_info)
  obj_info.style.display = 'none';

obj_info = document.getElementById("small_info");
if (obj_info)
  obj_info.style.display = 'none';

obj_info = document.getElementById("large_info");
if (obj_info)
  obj_info.style.display = 'none';

obj_info = document.getElementById("box_info");
if (obj_info)
  obj_info.style.display = 'none';
}


function alert_msgXY(titletext,bodytext,X,Y)
{
  obj_info = document.getElementById("info");
  obj_info.style.top =Y;
  obj_info.style.left = X;
 
  obj_info = document.getElementById("info");
  obj_info.style.display = 'block';
  obj_imagetitle = document.getElementById("imagetitle");
  obj_imagetitle.innerHTML = titletext;
  obj_imagebody = document.getElementById("imagebody");
  obj_imagebody.innerHTML = bodytext;
}


// popup window...
function opnwnd(thisUrl,ttl,features)
{
if (window.location.href == thisUrl)
 window.close();
 window.open(thisUrl,ttl,features);
}

// ...end em-txtbox.js

