/*
 * Created by MCreo - http://mcreo.pl/
 * http://mcreo.pl/
 * Copyright 2011, MCreo - Mateusz Łada
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: 17 November 2011
*/



// Wywoływanie i konfiguracja

$(document).ready(function() {
	
	$("body").MCreoPlusBOX({						// Panel Google +1
	color:			"red",							// Kolor blue/green/yellow/red/violet (przedrostek winter tworzy motyw zimowy, np. winterblue)
	plusadres:		"www.hotelkrolewski.com.pl/",					// Adres Twojej strony bez http:// z www lub bez www
	position:		"right",						// Pozycja right/left
	fadeSpeed:		800,							// Szybkość ruchu w ms
	pathname:		"http://hotelkrolewski.com.pl/wp-content/themes/stalowaprojektold/"		// Bezpośredni link do folderu mcreo_SlideBox
	});

	$("body").MCreoFaceBOX({						// Panel Facebook
	fbid:			"175307785836068",				// ID Twojej strony na Facebook
	color:			"winterred",					// Kolor blue/green/yellow/red/violet (przedrostek winter tworzy motyw zimowy, np. winterblue)
	position:		"right",						// Pozycja right/left
	fadeSpeed:		800,							// Szybkość ruchu w ms
	pathname:		"http://hotelkrolewski.com.pl/wp-content/themes/stalowaprojektold/"		// Bezpośredni link do folderu mcreo_SlideeBox
	});

});

// Koniec wywoływanie i konfiguracja


(function( jQuery ){
jQuery.fn.extend({
	MCreoFaceBOX: function( options ) {
		var defaults = {
			fbid		:	"246522795405841"	,
			color		:	"blue"				,
			position	:	"left"				,
			top			:	"220px"				,
			fadeSpeed	:	1000				,
		};
			
		var options = jQuery.extend(defaults, options);
		return this.each(function() {
		var o = options;
		var background = o.pathname + "mcreo_SlideBox/images/fb_" + o.color + "_bg_" + o.position + ".png";			
				
			jQuery("body").append(FB.init({
				appId  : o.fbid,
				status : true, 
				cookie : true, 
				xfbml  : true  
			}));
				
			jQuery("body").append('<div id="mcreo_facebox1"><div class="mcreo_facebox2"></div></div>');
				
			jQuery(".mcreo_facebox2").append('<fb:fan profile_id="'+o.fbid+'" stream="0" connections="12" logobar="0" width="242" height="321" border=0></fb:fan>');
				
			var obj = jQuery("#mcreo_facebox1");

			jQuery(obj).css("top" , o.top);
			jQuery(obj).css("background" , "url("+background+")");
			var hideDelay		= 300;
			var hideDelayTimer	= null;
				
			if(o.position=="right") { 
				jQuery(obj).css("width" , "253px");
				jQuery(obj).css("right" , "-269px");
					
				jQuery(obj).hover(function(){
				jQuery(obj).stop(true, false).animate({right:"0"},o.fadeSpeed);
				},function(){
				jQuery(obj).stop(true, false).animate({right:"-269"},o.fadeSpeed);
				},o.fadeSpeed);
				return false;
			}
				
			if(o.position=="left") {
				jQuery(obj).css("width" , "253px");
				jQuery(obj).css("left" , "-269px");
				jQuery(obj).css("background-position" , "right");
				jQuery(obj).css("padding" , "18px 40px 0 10px");
					
				jQuery(obj).hover(function(){
				jQuery(obj).stop(true, false).animate({left:"0"},o.fadeSpeed);
				},function(){
				jQuery(obj).stop(true, false).animate({left:"-269"},o.fadeSpeed);
				},o.fadeSpeed);
				return false;
			}
				
		});
	} 
});

})( jQuery );


(function( jQuery ){
jQuery.fn.extend({
	MCreoPlusBOX: function( options ) {
		var defaults = {
			color		:	"blue"				,
			plusadres	:	"www.mcreo.pl"		,
			position	:	"left"				,
			top			:	"100px"				,
			fadeSpeed	:	1000				,
		};
			
		var options = jQuery.extend(defaults, options);
		return this.each(function() {
		var o = options;
		var background = o.pathname + "mcreo_SlideBox/images/plus_" + o.color + "_bg_" + o.position + ".png";			
				
				
			jQuery("body").append('<div id="mcreo_plusebox1"><div class="mcreo_plusebox2"></div></div>');
				
			jQuery(".mcreo_plusebox2").append('<script type="text/javascript" src="https://apis.google.com/js/plusone.js">{lang: "pl"}</script><g:plusone size="tall" href="http://' + o.plusadres + '/"></g:plusone>');
				
			var obj = jQuery("#mcreo_plusebox1");

			jQuery(obj).css("top" , o.top);
			jQuery(obj).css("background" , "url("+background+")");
			var hideDelay		= 300;
			var hideDelayTimer	= null;
				
			if(o.position=="right") { 
				jQuery(obj).css("width" , "253px");
				jQuery(obj).css("right" , "-269px");
					
				jQuery(obj).hover(function(){
				jQuery(obj).stop(true, false).animate({right:"0"},o.fadeSpeed);
				},function(){
				jQuery(obj).stop(true, false).animate({right:"-269"},o.fadeSpeed);
				},o.fadeSpeed);
				return false;
			}
				
			if(o.position=="left") {
				jQuery(obj).css("width" , "253px");
				jQuery(obj).css("left" , "-269px");
				jQuery(obj).css("background-position" , "right");
				jQuery(obj).css("padding" , "18px 40px 0 10px");
					
				jQuery(obj).hover(function(){
				jQuery(obj).stop(true, false).animate({left:"0"},o.fadeSpeed);
				},function(){
				jQuery(obj).stop(true, false).animate({left:"-269"},o.fadeSpeed);
				},o.fadeSpeed);
				return false;
			}
				
		});
	} 
});
})( jQuery );

