/*
=======
FUNKCJE
=======
*/
/*
-------------------
WYĹWIETLANIE ALERTU
-------------------
*/
var loop_autohide;
var showAlert=function(alert_id,add_buttons,option,time_length)
{
var alerts_title=$("#alerts_title").attr("value");
var alerts_content=$("#alerts_content").attr("value");
alerts_title=explodeToAsoc(alerts_title,"|","=");
alerts_content=explodeToAsoc(alerts_content,"|","=");
var title=alerts_title[alert_id];
var content=alerts_content[alert_id];
$("#alerts").show();
$("#alerts h2").html(title);
$("#alerts p").html(content);
$("#alerts").css("bottom","-200px").show().stop(true,false).animate({"bottom":0},100);
$("#alerts .top_white_shadow").fadeIn(150);
$("#add_alert_buttons").html("");
$("#close_buttons").show();
$("#decisions_buttons").hide();
$("#alerts span").show();
$("#alerts a").hide();
if (option=="autohide")
{
var z=1;
loop_autohide=setInterval(function()
{
if (z==10)
{
closeAlert();
clearInterval(loop_autohide);
}
if ($("#alerts").css("display")=="none")
{
clearInterval(loop_autohide);
}
z++;
},time_length/10);
}
if (option=="gotoindex")
{
$("#alerts span").hide();
$("#alerts a").show();
}
}
/*
----------------
ZAMYKANIE ALERTU
----------------
*/
var closeAlert=function()
{
$("#alerts").animate({"bottom":"-200px"},200,function()
{
$("#alerts").hide();
clearInterval(loop_autohide);
});
$(".top_white_shadow").fadeOut(150);
}
/*
=====
AKCJE
=====
*/
$(document).ready(function()
{
/*
----------------
ZAMYKANIE ALERTU
----------------
*/
$("#alerts .close").live("click",function()
{
closeAlert();
});
$("#alert_no").live("click",function()
{
closeAlert();
});
/*
------------------------------------------------
WYĹWIETLENIE ALERTU Z POTWIERDZENIEM REJESTRACJI
------------------------------------------------
*/
if ($.cookie("confirm_alert")==1 || $.cookie("confirm_alert")==2)
{
var alert=$.cookie("confirm_alert");
if (alert==1) showAlert("alert_confirmcode_ok","",0,0);
if (alert==2) showAlert("alert_bad_confirmcode","",0,0);
$.cookie("confirm_alert",null)
}
/*
-----------------
RESETOWANIE HASĹA
-----------------
*/
if ($.cookie("reset_password_sid"))
{
var sid=$.cookie("reset_password_sid");
if (sid!="")
{
$.ajax(
{
type:"POST",
url:"include/sitemap/forgot_password/ajax.actions.php?action=send_new_password&sid="+sid,
data:"sid="+sid,
success:function(data)
{
if (data=="recover_ok")
{
showAlert("alert_send_new_password","",0,0);
}
else
{
showAlert("alert_recover_error","",0,0);
}
$.cookie("reset_password_sid",null);
}
});
}
}
});/*
=========
SCROLLERY
=========
*/
/*
=======
FUNKCJE
=======
*/
/*
--------------------
AKTUALIZACJA SUWAKĂW
--------------------
*/
var updateScrollers=function(objects)
{
$("."+objects).each(function()
{
var this_obj=$(this);
var parent_h=this_obj.parent().css("height");
var parent_w=this_obj.parent().css("width");
var container_h=parent_h;
var content_h=this_obj.children(".mask").children(".content").css("height");
var scroller_w=this_obj.children(".scroller").css("width");
container_h=eval(container_h.replace("px",""));
content_h=eval(content_h.replace("px",""));
parent_w=parent_w.replace("px","");
scroller_w=scroller_w.replace("px","");
var ratio=roundNumber(eval(container_h)/eval(content_h),2);
var handle_h=Math.floor(eval(container_h)*eval(ratio));
this_obj.css("height",container_h);
this_obj.children(".scroller").children(".handle").css({"height":handle_h+"px"/*,"top":0*/});
//this_obj.children(".mask").children(".content").css({"margin-top":0});
if ($(this).attr("id")=="dir_tree")
{
//alert((content_h-1)+" - "+container_h)
}
if ((content_h-1)<=container_h)
{
this_obj.children(".scroller").animate({"right":"-"+scroller_w+"px"},150,function()
{
this_obj.children(".mask").css({"border-right":0}).animate({"width":"100%"},150);
/*
SKALOWANIE PRZYLEGĹYCH WARSTW Z KLASÄ SCROLL_RESIZABLE
*/
this_obj.parent("div").prevAll(".scroll_resizable").css({"padding-right":0});
this_obj.parent("div").nextAll(".scroll_resizable").css({"padding-right":0});
});
}
else
{
/*
SKALOWANIE PRZYLEGĹYCH WARSTW Z KLASÄ SCROLL_RESIZABLE
*/
if (container_h!=0)
{
this_obj.parent("div").prevAll(".scroll_resizable").css({"padding-right":"11px"});
this_obj.parent("div").nextAll(".scroll_resizable").css({"padding-right":"11px"});
this_obj.children(".mask").css({"border-right":"1px solid #ddd"}).animate({"width":eval(parent_w-11)+"px"},150,function()
{
this_obj.children(".scroller").animate({"right":0,"top":0},150);
});
}
}
});
}
/*
---------------------------
SPRAWDZANIE POZYCJI SUWAKĂW
---------------------------
*/
var checkHandlePosition=function()
{
var mouse_on_handle=$("#mouse_on_handle").attr("value");
var this_obj=mouse_on_handle;
if (mouse_on_handle!=0)
{
var handle_y=$("#"+this_obj).css("top");
var handle_h=$("#"+this_obj).css("height");
var container_h=$("#"+this_obj).parent(".scroller").parent(".scroll_container").css("height");
var content_h=$("#"+this_obj).parent(".scroller").prev(".mask").children(".content").css("height");
content_h=eval(content_h.replace("px",""));
handle_y=eval(handle_y.replace("px",""));
handle_h=eval(handle_h.replace("px",""));
container_h=eval(container_h.replace("px",""));
var ratio=roundNumber(eval(container_h/content_h),2);
var new_y=roundNumber(eval(handle_y/ratio),2);
if (handle_y==eval(container_h-handle_h))
{
new_y=eval(content_h-container_h);
}
$("#"+this_obj).parent(".scroller").prev(".mask").children(".content").css({"margin-top":-new_y+"px"});
}
}
/*
----------------------
ZAĹADOWANIE SCROLLERĂW
----------------------
*/
var loadScrollers=function(objects,step)
{
$(".handle").multidraggable({scroll:false,"containment":"parent"});
$(".handle").live("mousedown",function(){$("#mouse_on_handle").attr("value",$(this).attr("id"));});
$(".handle").live("mouseup",function(){$("#mouse_on_handle").attr("value",0);});
$("."+objects).bind("mousewheel",function(event,delta)
{
var dir=delta>0?'up':'down';
var this_obj=$(this);
var container_h=this_obj.css("height");
var content_h=this_obj.children(".mask").children(".content").css("height");
//alert(container_h);
var content_y=this_obj.children(".mask").children(".content").css("margin-top");
var handle_y=$(this).children(".scroller").children(".handle").css("top");
var handle_h=$(this).children(".scroller").children(".handle").css("height");
container_h=eval(container_h.replace("px",""));
content_y=eval(content_y.replace("px",""));
content_h=eval(content_h.replace("px",""));
handle_y=eval(handle_y.replace("px",""));
handle_h=eval(handle_h.replace("px",""));
var ratio=roundNumber(eval(container_h/content_h),2);
if (content_h>container_h)
{
if (dir=="up")
{
content_y=eval(content_y+step);
if (content_y>0) content_y=0;
$(this).children(".mask").children(".content").css({"margin-top":content_y+"px"});
var handle_y=Math.floor(content_y*ratio);
$(this).children(".scroller").children(".handle").css({"top":-handle_y+"px"});
}
if (dir=="down")
{
content_y=eval(content_y-step);
var handle_y=Math.floor(content_y*ratio);
if (handle_y==eval(container_h-handle_h))
{
handle_y=eval(content_h-container_h);
}
if (eval(-content_y+container_h)>content_h)
{
content_y=eval(container_h-content_h+1);
handle_y=eval(container_h-handle_h)*-1;
}
$(this).children(".mask").children(".content").css({"margin-top":content_y+"px"});
$(this).children(".scroller").children(".handle").css({"top":-handle_y+"px"});
}
return false;
}
});
}
/*
=====
AKCJE
=====
*/
$(document).ready(function()
{
updateScrollers("scroll_container");
loadScrollers("scroll_container",30);
/*
---------------------------------------------
SPRAWDZANIE POZYCJI MYSZKI I STANU PRZYCISKĂW
---------------------------------------------
*/
$(document).bind("mousemove",function(e)
{
checkHandlePosition();
});
});var runSlider=function(this_obj,successFn)
{
var slider_fx=this_obj.find(".slider_fx").attr("value");
var slider_speed=this_obj.find(".slider_speed").attr("value");
var slider_timeout=this_obj.find(".slider_timeout").attr("value");
var slider_pause=this_obj.find(".slider_pause").attr("value");
var slider_pager=this_obj.find(".slider_pager").attr("value");
var id=this_obj.attr("id");
$("#"+id).children("div.component_slider").cycle(
{
fx:slider_fx,
speed:slider_speed,
timeout:slider_timeout,
pause:slider_pause,
pager:"#"+id+" .pager",
});
successFn();
}
$(document).ready(function()
{
$(".component").each(function()
{
var is_slider=$(this).hasClass("slider");
if (is_slider)
{
var this_obj=$(this);
runSlider(this_obj,function(){});
}
});
});/*
=======
FUNKCJE
=======
*/
/*
=====
AKCJE
=====
*/
$(document).ready(function()
{
/*
-------------------------------------------
ZAMYKANIE IDIOTYCZNEGO KOMUNIKATU O COOKIES
-------------------------------------------
*/
if($.cookie('show_stupid_cookie_info') == 1) {
$("#cookies_info").hide();
}
$("#close_cookies_info").live("click",function()
{
$("#cookies_info").fadeOut(200);
$.cookie("show_stupid_cookie_info",1,{expires:365,path:'/'});
});
});// =======
// FUNKCJE
// =======
// =====
// AKCJE
// =====
$(document).ready(function()
{
/*
----
MENU
----
*/
$("ul.sitemap_group li").live("mouseenter",function()
{
$(this).children("ul").stop(true,true).fadeIn(200);
});
$("ul.sitemap_group li").live("mouseleave",function()
{
$(this).children("ul").stop(true,true).fadeOut(200);
});
});/*
=======
FUNKCJE
=======
*/
/*
=====
AKCJE
=====
*/
$(document).ready(function()
{
/*
-------------------------------------------
FORMULARZ KONTAKTOWY - WYSYĹANIE WIADOMOĹCI
-------------------------------------------
*/
$("#send_message").click(function()
{
var validate_empties=1;
if ($("#name").attr("value")=="") { validate_empties=0; $("#name").addClass("validate_inputs"); }
if ($("#email").attr("value")=="") { validate_empties=0; $("#email").addClass("validate_inputs"); }
if ($("#message").attr("value")=="") { validate_empties=0; $("#message").addClass("validate_inputs"); }
if (validate_empties==1)
{
$("#loader_send_message").fadeIn(100);
$.ajax(
{
type:"POST",
url:"_nugen.cms/components/contact_form/ajax.actions.php?action=send_message",
data:$("#ajax_contact_form").serialize(),
success:function(data)
{
showAlert("alert_message_sended","",0,0);
$("#name").attr("value","");
$("#phone").attr("value","");
$("#email").attr("value","");
$("#message").attr("value","");
$("#loader_send_message").fadeOut(100);
}
});
}
else
{
showAlert("alert_fill_required","",0,0);
}
});
});/*
=========================
KOMPONENT - GALERIA ZDJÄÄ
=========================
*/
/*
=======
PLUGINY
=======
*/
(function($)
{
$.fn.extendLightBox=function(parameters)
{
$(this).children("a").lightBox({txtImage:" ",txtOf:"/"});
}
})(jQuery);
/*
=======
FUNKCJE
=======
*/
/*
==============================================
AKCJE I ZDARZENIA PO ZAĹADOWANIU SIÄ DOKUMENTU
==============================================
*/
$(document).ready(function()
{
$(".component_gallery li").live("mouseenter",function()
{
$(this).find("img").stop(true,false).animate({"max-height":"93%","max-width":"93%"},50);
});
$(".component_gallery li").live("mouseleave",function()
{
$(this).find("img").stop(true,false).animate({"max-height":"85%","max-width":"85%"},150);
});
$(".component").each(function()
{
var is_gallery=$(this).hasClass("gallery");
if (is_gallery)
{
$(this).children(".component_gallery").children("li").extendLightBox();
}
});
});// =======
// FUNKCJE
// =======
// =====
// AKCJE
// =====
$(document).ready(function()
{
$(".map_bt").live("mouseenter",function()
{
var alt=$(this).attr("alt");
$("#img_"+alt).stop(false,true).fadeIn(500);
});
$(".map_bt").live("mouseleave",function()
{
var alt=$(this).attr("alt");
$("#img_"+alt).stop(false,true).fadeOut(500);
});
});/*
=======================================
KOMPONENT - SZYBKI FORMULARZ KONTAKTOWY
=======================================
*/
/*
=======
FUNKCJE
=======
*/
/*
=====================================
AKCJE PO ZAĹADOWANIU CAĹEGO DOKUMENTU
=====================================
*/
$(document).ready(function()
{
/*
--------------------
WYSYĹANIE WIADOMOĹCI
--------------------
*/
$(".send_quick_form").click(function()
{
var validate_ok=1;
var validation=$(this).nextAll("input.validation").attr("value");
var alt_name=$("#name").attr("alt");
var alt_phone=$("#phone").attr("alt");
var alt_email=$("#email").attr("alt");
var alt_hour=$("#hour").attr("alt");
var value_name=$("#name").attr("value");
var value_phone=$("#phone").attr("value");
var value_email=$("#email").attr("value");
var value_hour=$("#hour").attr("value");
if (validation==1)
{
$(this).parent("form").children("input").each(function()
{
var value=$(this).attr("value");
if (value=="")
{
validate_ok=0;
return false;
}
});
}
if (alt_name==value_name || alt_phone==value_phone || alt_email==value_email || alt_hour==value_hour)
{
validate_ok=0;
}
if (validate_ok==1)
{
$(this).parent("form").children(".loader_quick_form").fadeIn(100);
$.ajax(
{
type:"POST",
url:"_nugen.cms/components/quick_form/ajax.actions.php?action=send_quick_form",
data:$(this).parent(".component_quick_form").serialize(),
success:function(data)
{
showAlert("alert_message_sended","",0,0);
$("#name").attr("value",alt_name);
$("#phone").attr("value",alt_phone);
$("#email").attr("value",alt_email);
$("#hour").attr("value",alt_hour);
$(".loader_quick_form").fadeOut(100);
}
});
}
else
{
showAlert("alert_fill_required","",0,0);
}
});
});/*
=========================
KOMPONENT - GALERIA ZDJÄÄ
=========================
*/
/*
=======
FUNKCJE
=======
*/
/*
FUNKCJA - SPRAWDZANIE ROZMIARU OKNA PRZEGLÄDARKI
I DOPASOWANIE DO NIEGO ELEMENTU 'RODZICA' GALERII
*/
var checkBodySize=function()
{
var body_w=eval(($("body").css("width")).replace("px",""));
var window_h=$(window).height();
if ($("#component_adv_gallery_mask").length)
{
var parent_x=eval(($("#component_adv_gallery_mask").parent().css("left")).replace("px",""));
var thumbs_w=eval(($("#component_adv_gallery").css("width")).replace("px",""));
var adv_gallery_w=body_w-parent_x;
var thumbs_center=Math.ceil((adv_gallery_w/2)+parent_x);
var ratio=roundNumber(thumbs_w/adv_gallery_w,2);
var thumb_h=eval(window_h)-250;
var arrow_x=Math.ceil((eval(adv_gallery_w)/13));
var arrows_y=Math.ceil((eval(thumb_h)/2)-20);
var menu_y=Math.ceil((eval(window_h)/2)-20);
var login_y=Math.ceil((eval(window_h)/2)-100);
var oferta_y=Math.ceil((eval(window_h)/2)-250);
var kontakt_y=Math.ceil((eval(window_h)/2)-175);
var img_ratio=eval(body_w)/1920;
var menu_margin_left=Math.ceil(eval(body_w)/35);
$("#arrow_left").css({"top":arrows_y+"px","left":arrow_x+"px"});
$("#arrow_right").css({"top":arrows_y+"px","right":arrow_x+"px"});
$("#gallery_menu").css({"top":eval(menu_y)+5+"px"});
$("#login_field").css({"top":eval(login_y)+"px"});
$("#oferta_field").css({"top":eval(oferta_y)+"px"});
$("#kontakt_field").css({"top":eval(kontakt_y)+"px"});
$("#gallery_menu").css({"margin-left":menu_margin_left+"px"});
$("#gallery_menu li").each(function()
{
var id=$(this).attr("id");
if (id!="fotoalbum")
{
//var width=eval(($(this).css("width")).replace("px",""));
//var height=eval(($(this).css("height")).replace("px",""));
var img_size=$(this).attr("alt");
img_size=img_size.split("x");
width=Math.ceil(img_size[0]*img_ratio);
height=Math.ceil(img_size[1]*img_ratio);
$(this).css({"width":width+"px","height":height+"px"});
$(this).children("img").css({"width":width+"px","height":height+"px"});
}
});
$("#component_adv_gallery_mask").parent().css({"width":adv_gallery_w+"px"});
//$("#thumbs_container").css({"width":parseInt(adv_gallery_w)-100+"px"});
$("#thumb_zoom").css({"width":adv_gallery_w+"px","height":thumb_h+"px"});
$("#thumbs_center").attr("value",thumbs_center);
$("#body_w").attr("value",body_w);
$("#parent_x").attr("value",parent_x);
$("#adv_gallery_w").attr("value",adv_gallery_w);
$("#ratio").attr("value",ratio);
}
}
/*
FUNKCJA - SPRAWDZANIE ROZMIARU OKNA PRZEGLÄDARKI
I DOPASOWANIE DO NIEGO ELEMENTU 'RODZICA' GALERII
*/
var loadGalleryThumbs=function(gallery_dir)
{
$.ajax(
{
url:"_nugen.cms/components/adv_gallery/ajax.actions.php?action=load_thumbs_list&gallery_dir="+gallery_dir,
success:function(data)
{
data=data.split("####");
$("#arrow_right").addClass("blocked");
$("#arrow_left").addClass("blocked");
$("#component_adv_gallery").html(data[0]);
$("#adv_gallery_zoom").attr("src",data[1]).hide();
$("#all_photos").attr("value",data[2]);
$("#zoom_loader").fadeIn(200);
var image=$("#adv_gallery_zoom");
var timer=setInterval(function()
{
if (image[0].complete==true)
{
$("#zoom_loader").fadeOut(200,function()
{
$("#adv_gallery_zoom").fadeIn(200);
$("#arrow_right").removeClass("blocked");
$("#arrow_left").removeClass("blocked");
});
clearInterval(timer);
}
},50);
$("#thumbs_container").css({"width":data[3]+"px"});
}
});
}
/*
==============================================
AKCJE I ZDARZENIA PO ZAĹADOWANIU SIÄ DOKUMENTU
==============================================
*/
$(document).ready(function()
{
var get_id=$("#get_id").attr("value");
if ($("#component_adv_gallery_mask").length)
{
/*
DETEKCJA ZMIANY ROZMIARU OKNA PRZEGLÄDARKI
*/
$(window).bind("resize",function()
{
checkBodySize();
});
/*
UKRYCIE GALERII NA STARCIE
*/
$("#component_adv_gallery_mask").hide();
$("#thumb_zoom").hide();
if (get_id=="main")
{
$("#body_dark_mask").hide();
}
checkBodySize();
/*
PORUSZANIE MINIATUR NA MYSZKÄ
*/
/*
$("#component_adv_gallery").live("mouseenter",function()
{
$("#component_adv_gallery").addClass("mouseover");
});
$("#component_adv_gallery").live("mouseleave",function()
{
$("#component_adv_gallery").removeClass("mouseover");
});
$(document).bind("mousemove",function(e)
{
var parent_x=eval($("#parent_x").attr("value"));
var adv_gallery_w=eval($("#adv_gallery_w").attr("value"));
var thumbs_center=eval($("#thumbs_center").attr("value"));
var body_w=eval(($("body").css("width")).replace("px",""));
var thumbs_w=eval(($("#component_adv_gallery").css("width")).replace("px",""));
var thumbs_x=eval(($("#component_adv_gallery").css("left")).replace("px",""));
var mouse_x=e.pageX;
var mouse_y=e.pageY;
var ratio=roundNumber((eval(thumbs_w)-eval(adv_gallery_w))/adv_gallery_w,2);
var is_mouseover=$("#component_adv_gallery").hasClass("mouseover");
// PRZEWIJANIE NA BOKACH, IM DALEJ ĹRODKA MINIATURY PRZEWIJAJÄ SIÄ SZYBCIEJ
if (mouse_x>eval(parent_x) && mouse_x0)
{
direction="left";
}
else
{
direction="right";
moveby=moveby*-1;
}
moveby=Math.ceil(moveby/20);
if (moveby<0) moveby=0;
if (direction=="left")
{
if (thumbs_x<0) $("#component_adv_gallery").stop(false,true).animate({"left":"+="+moveby+"px"},300);
}
if (direction=="right")
{
if (thumbs_x>-thumbs_w+adv_gallery_w) $("#component_adv_gallery").stop(false,true).animate({"left":"-="+moveby+"px"},300);
}
//$("#element_35995").html(moveby+" - "+direction);
}
// PRZEWIJANIE WSZYSKICH ZDJÄÄ MYSZKÄ NA SKALI SZEROKOĹCI POJEMNIKA GALERII
if (mouse_x>eval(parent_x)+100 && mouse_xbody_w-100)
{
$("#component_adv_gallery").stop(false,false).animate({"left":"-"+(thumbs_w-eval(adv_gallery_w)+25)+"px"},300);
}
});
*/
/*
KLIKNIÄCIE W MINIATURÄ
*/
$("#component_adv_gallery li img").live("click",function()
{
var src=($(this).attr("src")).replace("thumbs","original");
var parent_alt=$(this).parent().attr("alt");
var current_thumb=$("#current_thumb").attr("value");
var all_photos=$("#all_photos").attr("value");
var moveby_x="-=300px";
var move_reset="+=600px";
if (current_thumb!=parent_alt)
{
if (parent_alt==1) $("#arrow_left").fadeOut(200); else $("#arrow_left").fadeIn(200);
if (parent_alt==all_photos) $("#arrow_right").fadeOut(200); else $("#arrow_right").fadeIn(200);
$("#arrow_right").addClass("blocked");
$("#arrow_left").addClass("blocked");
if (eval(current_thumb)1)
{
$("#thumb_"+current_thumb).parent().prev().children("img").trigger("click");
$("#arrow_right").fadeIn(200);
var current_thumb=$("#current_thumb").attr("value");
if (current_thumb==1)
{
$("#arrow_left").fadeOut(200);
}
}
}
});
/*
PRAWA STRZAĹKA PRZY MINIATURACH
*/
$("#thumbs_arrow_right").live("click",function()
{
var adv_gallery_w=$("#adv_gallery_w").attr("value");
var thumbs_x=parseInt(($("#component_adv_gallery").css("left")).replace("px",""));
var thumbs_w=parseInt(($("#component_adv_gallery").css("width")).replace("px",""));
var new_thumbs_x=0;
adv_gallery_w=parseInt(adv_gallery_w)-140;
new_thumbs_x=thumbs_x-adv_gallery_w;
if (new_thumbs_x-adv_gallery_w70)
{
new_thumbs_x=70;
$("#thumbs_arrow_left").fadeOut(200);
}
$("#component_adv_gallery").stop(false,true).animate({"left":new_thumbs_x+"px"},300);
$("#thumbs_arrow_right").fadeIn(200);
});
/*
ZAMYKANIE GALERII
*/
$("#close_gallery").live("click",function()
{
var get_id=$("#get_id").attr("value");
$.cookie("login_folder","",{expires:356,path:'../'});
$("#component_adv_gallery_mask").fadeOut(300);
$("#thumb_zoom").fadeOut(300);
$("#adv_gallery_zoom").attr("src","");
$("#gallery_menu li").children("img.f").css({"opacity":1,"left":0});
$("#gallery_menu li").children("img.s").css({"opacity":0,"left":0});
//$("#gallery_menu li").hide().fadeIn(300);
if (get_id=="main")
{
$("#body_dark_mask").fadeOut(300);
var delay=300;
$("#gallery_menu li").hide();
$("#gallery_menu li").each(function()
{
$(this).stop(true,true).fadeIn(delay);
delay=eval(delay)+300;
});
}
if (get_id=="prywatne_galerie")
{
$("#login_field").fadeIn(200);
$("#ajax_login").fadeIn(200);
}
if (get_id=="oferta")
{
$("#oferta_field").fadeIn(200);
}
});
/*
MENU GALERII - NAJECHANIE I ZJECHANIE
*/
var body_bg=$("body").css("background-image");
var bg_levelup="";
$("#gallery_menu li").live("mouseenter",function()
{
var id=$(this).attr("id");
$(this).children("img.s").stop(true,true).animate({"left":0,"opacity":1},200);
$(this).children("img.f").stop(true,true).animate({"left":"-35px","opacity":0},300);
$(".bg_photos").css({"z-index":1});
$("#bg_"+id).css({"z-index":2,"opacity":1});
});
$("#gallery_menu li").live("mouseleave",function()
{
var id=$(this).attr("id");
$(this).children("img.f").stop(true,true).animate({"left":0,"opacity":1},200);
$(this).children("img.s").stop(true,true).animate({"left":"-25px","opacity":0},300);
});
/*
MENU GALERII - KLIKNIÄCIE
*/
$("#gallery_menu li").live("click",function()
{
var id=$(this).attr("id");
$(".bg_photos").css({"z-index":1});
$("#bg_"+id).css({"z-index":2});
loadGalleryThumbs(id);
$("#gallery_menu li").stop(true,true).fadeOut(100);
$("#body_dark_mask").fadeIn(600);
$("#thumb_zoom").fadeIn(300,function()
{
$("#component_adv_gallery_mask").css({"bottom":"-=300px"}).show().animate({"bottom":"+=300px"},300)
});
});
/*
LOGOWANIE DO PRYWATNEJ GALERII
*/
$("#gallery_login_bt").live("click",function()
{
var login=$("#login").attr("value");
var password=$("#password").attr("value");
if (login!="" && password!="")
{
$("#ajax_login").fadeOut(200,function()
{
$.ajax(
{
type:"POST",
url:"_nugen.cms/components/adv_gallery/ajax.actions.php?action=login",
data:$("#ajax_login").serialize(),
success:function(data)
{
if (data!="bad_login")
{
data=data.split("####");
$.cookie("login_folder",data[3],{expires:365,path:'../'});
$("#info_login_ok").fadeIn(200).delay(1000).fadeOut(200,function()
{
$("#login_field").fadeOut(200);
$("#thumb_zoom").fadeIn(300,function()
{
$("#component_adv_gallery_mask").css({"bottom":"-=300px"}).show().animate({"bottom":"+=300px"},300)
});
$("#arrow_right").addClass("blocked");
$("#arrow_left").addClass("blocked");
$("#component_adv_gallery").html(data[0]);
$("#adv_gallery_zoom").attr("src",data[1]).hide();
$("#all_photos").attr("value",data[2]);
$("#zoom_loader").fadeIn(200);
var image=$("#adv_gallery_zoom");
var timer=setInterval(function()
{
if (image[0].complete==true)
{
$("#zoom_loader").fadeOut(200,function()
{
$("#adv_gallery_zoom").fadeIn(200);
$("#arrow_right").removeClass("blocked");
$("#arrow_left").removeClass("blocked");
});
clearInterval(timer);
}
},50);
});
}
else
{
$("#info_bad_login").fadeIn(200).delay(1000).fadeOut(200,function()
{
$("#ajax_login").fadeIn(200);
});
}
}
});
});
}
});
/*
GALERIA Z FOTOLABUMEM
*/
$("#gallery_fotoalbum").live("click",function()
{
$("#oferta_field").fadeOut(200);
$("#fotoalbum").trigger("click");
});
if ($.cookie("login_folder")!="" && get_id=="prywatne_galerie")
{
loadGalleryThumbs($.cookie("login_folder"));
$("#login_field").hide();
$("#thumb_zoom").fadeIn(300,function()
{
$("#component_adv_gallery_mask").css({"bottom":"-=300px"}).show().animate({"bottom":"+=300px"},300)
});
}
}
});/*
=========================
KOMPONENT - GALERIA ZDJÄÄ
=========================
*/
/*
=======
PLUGINY
=======
*/
(function($)
{
$.fn.extendLightBox=function(parameters)
{
if ($(this).length)
{
$(this).children("a").lightBox({txtImage:" ",txtOf:"/"});
}
}
})(jQuery);
/*
=======
FUNKCJE
=======
*/
/*
==============================================
AKCJE I ZDARZENIA PO ZAĹADOWANIU SIÄ DOKUMENTU
==============================================
*/
$(document).ready(function()
{
$(".visualization_gallery li").live("mouseenter",function()
{
$(this).find("img").stop(true,false).animate({"max-height":"93%","max-width":"93%"},50);
});
$(".visualization_gallery li").live("mouseleave",function()
{
$(this).find("img").stop(true,false).animate({"max-height":"85%","max-width":"85%"},150);
});
if ($(".visualization_gallery").length) $(".visualization_gallery").children("li").extendLightBox();
if ($(".zdjecia_gallery").length) $(".zdjecia_gallery").children("li").extendLightBox();
if ($(".rzuty_gallery").length) $(".rzuty_gallery").children("li").extendLightBox();
$(".pager p").live("click",function()
{
var page=$(this).html();
var current_page=$("#current_page").attr("value");
$(".pager p").removeClass("active");
//$(this).addClass("active");
$(".pager p").each(function()
{
var html=$(this).html();
if (html==page) $(this).addClass("active");
});
$("#offers_page"+current_page).fadeOut(200,function()
{
$("#offers_page"+page).fadeIn(200);
$("#current_page").attr("value",page);
});
});
$(".offers_cell").each(function()
{
$(this).children().extendLightBox();
});
});
/*
==============================================
AKCJE I ZDARZENIA PO ZAĹADOWANIU SIÄ DOKUMENTU
==============================================
*/
$(document).ready(function()
{
$(".pager p").live("click",function()
{
var page=$(this).html();
var current_page=$("#current_page").attr("value");
$(".pager p").removeClass("active");
$(".pager p").each(function()
{
var html=$(this).html();
if (html==page) $(this).addClass("active");
});
$("#articles_page"+current_page).fadeOut(200,function()
{
$("#articles_page"+page).fadeIn(200);
$("#current_page").attr("value",page);
});
});
$(".articles_cell").each(function()
{
$(this).children().extendLightBox();
});
});
/*
==============================================
AKCJE I ZDARZENIA PO ZAĹADOWANIU SIÄ DOKUMENTU
==============================================
*/
$(document).ready(function()
{
$(".pager p").live("click",function()
{
var page=$(this).html();
var current_page=$("#current_page").attr("value");
$(".pager p").removeClass("active");
$(".pager p").each(function()
{
var html=$(this).html();
if (html==page) $(this).addClass("active");
});
$("#items_page"+current_page).fadeOut(200,function()
{
$("#items_page"+page).fadeIn(200);
$("#current_page").attr("value",page);
});
});
/*
$(".items_cell").each(function()
{
$(this).children().extendLightBox();
});
*/
$(".minigallery a").lightBox({txtImage:" ",txtOf:"/"});
});
/*
=======
FUNKCJE
=======
*/
/*
==============================================
AKCJE I ZDARZENIA PO ZAĹADOWANIU SIÄ DOKUMENTU
==============================================
*/
$(document).ready(function()
{
});
/*
=======
FUNKCJE
=======
*/
/*
==============================================
AKCJE I ZDARZENIA PO ZAĹADOWANIU SIÄ DOKUMENTU
==============================================
*/
$(document).ready(function()
{
/*
-------------------------
WYSZUKIWANIE ZAAWANSOWANE
-------------------------
*/
$("#advanced_search").live("click",function()
{
var advanced_visibility=$("#advanced_visibility").attr("value");
if (advanced_visibility==0)
{
$("#advanced_search_field_mask").show();
$("#advanced_search_field").animate({"top":0},300);
$("#advanced_visibility").attr("value",1)
}
else
{
$("#advanced_search_field").animate({"top":"-140px"},300,function()
{
$("#advanced_search_field_mask").hide();
$("#advanced_visibility").attr("value",0)
});
}
});
/*
---------------------------
DODATKOWY PRZYCISK SZUKANIA
---------------------------
*/
$("#bt_add_search").click(function()
{
$("#bt_search").trigger("click");
});
});
/*
==============================================
AKCJE I ZDARZENIA PO ZAĹADOWANIU SIÄ DOKUMENTU
==============================================
*/
$(document).ready(function()
{
/*
ĹADOWANIE ZDJÄÄ PRODUKTĂW
*/
$(".item_icon img.loading").each(function()
{
var image=$(this);
var loop=setInterval(function()
{
if (image[0].complete==true)
{
image.show();
clearInterval(loop);
}
},50);
});
/*
---------------------
ZLINKOWANIE PRODUKTĂW
---------------------
*/
$(".item_icon").live("click",function()
{
var id=$(this).attr("alt");
id=id.split("|");
var group_id=id[0];
var item_id=id[1];
gotourl("produkty/"+group_id+"/"+item_id);
});
});