/* * * Easy front-end framework * * Copyright (c) 2011 Alen Grakalic * http://easyframework.com/license.php * * supported by Templatica (http://templatica.com) * and Css Globe (http://cssglobe.com) * * built to be used with jQuery library * http://jquery.com * * update: Mar 22nd 2011 * */ (function($){$.easy={navigation:function(_11){var _12={selector:"#nav li, nav li",className:"over"};if(typeof _11=="string"){_12.selector=_11;}var _11=$.extend(_12,_11);return $(_11.selector).each(function(){$(this).hover(function(){$("ul:first",this).fadeIn(100);$(this).addClass(_11.className);},function(){$("ul",this).hide();$(this).removeClass(_11.className);});});},tooltip:function(_13){var _14={selector:".tooltip",xOffset:10,yOffset:25,clickRemove:false,id:"easy_tooltip",content:"",useElement:""};if(typeof _13=="string"){_14.selector=_13;}var _13=$.extend(_14,_13);var _15;return $(_13.selector).each(function(){var _16=$(this).attr("title");$(this).hover(function(e){_15=(_13.content!="")?_13.content:_16;_15=(_13.useElement!="")?$("#"+_13.useElement).html():_15;$(this).attr("title","");if(_15!=""&&_15!=undefined){$("body").append("
"+_15+"
");$("#"+_13.id).css({"position":"absolute","display":"none"}).css("top",(e.pageY-_13.yOffset)+"px").css("left",(e.pageX+_13.xOffset)+"px").fadeIn("fast");}},function(){$("#"+_13.id).remove();$(this).attr("title",_16);});$(this).mousemove(function(e){var x=((e.pageX+_13.xOffset+$(this).width())<$(window).width())?(e.pageX+_13.xOffset):(e.pageX-_13.xOffset-$(this).width()-16);$("#"+_13.id).css("top",(e.pageY-_13.yOffset)+"px").css("left",(x+"px"));});if(_13.clickRemove){$(this).mousedown(function(e){$("#"+_13.id).remove();$(this).attr("title",_16);});}});},popup:function(_17){var _18={selector:".popup",popupId:"easy_popup",preloadText:"Loading...",errorText:"There has been a problem with your request, please click outside this window to close it.",closeText:"Close",prevText:"« Previous",nextText:"Next »",opacity:0.7,hiddenClass:"hidden",callback:function(){}};if(typeof _17=="string"){_18.selector=_17;}var _17=$.extend(_18,_17);return $(_17.selector).each(function(i){var obj=this;var _19,_1a;var _1b=true;var _1c=this.tagName.toLowerCase();if($(this).hasClass("gallery")){var _1d=$(this).attr("class");_1d=_1d.split(" ").join("");$.data(this,"gallery",_1d);eval("if((typeof "+_1d+"_arr == \"undefined\")) "+_1d+"_arr= new Array()");eval(_1d+"_arr").push($(this));$.data(this,"index",eval(_1d+"_arr").length-1);}if($.browser.opera){$.support.opacity=true;}var ie6=$.browser.msie&&$.browser.version.substr(0,1)<7;var _1e=$.browser.opera&&$.browser.version<=9.5;var w,h,w2,h2;var cw,ch;cw=ch=0;var _1f=false;var _20=function(){w=$(window).width();h=$(document).height();w2=$(window).width()/2;h2=$(window).height()/2;if($("#"+_17.popupId).length==0){$("
").appendTo("body").css({"width":w,"height":h,"position":"absolute","top":"0","left":"0","z-index":"10000","opacity":_17.opacity}).click(function(){_26();});}$("
"+_17.preloadText+"
").appendTo("body");set($("#"+_17.popupId+"_preloader"));$("
").appendTo("body").css({"visibility":"hidden","position":"absolute","top":"-10000px","left":"-10000px"});$("
").appendTo("#"+_17.popupId+"_content").css({"overflow":"auto","height":"100%"});$(""+_17.closeText+"").appendTo("#"+_17.popupId+"_inner").click(function(){_26();});var rel=$(obj).attr("rel").split(";");$.each(rel,function(i){if(rel[i].indexOf("width")!=-1){cw=rel[i].split(":")[1];}if(rel[i].indexOf("height")!=-1){ch=rel[i].split(":")[1];}});if($(obj).attr("title")!=""){$(""+$(obj).attr("title")+"").appendTo("#"+_17.popupId+"_content").hide();}};var _21=function(){$("#"+_17.popupId+"_preloader").remove();var _22=$("#"+_17.popupId+"_content");var fh=false;if(cw!=0){$(_22).css("width",parseInt(cw));}if(ch!=0){$(_22).css("height",parseInt(ch));fh=true;}if($(_22).width()>($(window).width()-50)){$(_22).css("width",$(window).width()-50);}if($(_22).height()>($(window).height()-50)){$(_22).css("height",$(window).height()-50);fh=true;}$(".caption",_22).css({"width":$(_22).width(),"display":"block"});if($(".caption",_22).height()>0){if(fh){$("#"+_17.popupId+"_inner").height($("#"+_17.popupId+"_inner").height()-$(".caption",_22).outerHeight());}}set($("#"+_17.popupId+"_content"));$("#"+_17.popupId+"_content").css("visibility","visible");};var set=function(_23){$(_23).css({"text-align":"left","float":"left","position":"fixed","z-index":"10001","visible":"hidden"});var _24=w2-$(_23).width()/2;var top=h2-$(_23).height()/2;$(_23).css({"left":_24,"top":top,"display":"none"}).fadeIn("1000");if(ie6){$(_23).css({"position":"absolute","top":(top+$(window).scrollTop())+"px"});}if(_1e){$(_23).css({"position":"absolute","top":(document.body["clientHeight"]/2-$(obj).height()/2+$(window).scrollTop())+"px"});}if(ie6){$("embed, object, select").css("visibility","hidden");}};var _25=function(){$("#"+_17.popupId+"_content").text(_17.errorText);_21();};var _26=function(){if(!_1b){$(_19).addClass(_17.hiddenClass).appendTo(_1a);}$("#"+_17.popupId).remove();$("#"+_17.popupId+"_content").remove();$("#"+_17.popupId+"_preloader").remove();if(ie6){$("embed, object, select").css("visibility","visible");}_17.callback();};if(_1c!="a"){_26();_20();_19=this;_1b=$(_19).is(":visible");_1a=$(_19).parent();if(_1b){_19=$(_19).clone();}$(_19).removeClass(_17.hiddenClass).appendTo("#"+_17.popupId+"_inner").show();_21();}else{$(this).bind("click",function(e){e.preventDefault();_26();_20();var _27=$(this).attr("href");var _28=_27.substr(_27.lastIndexOf(".")).toLowerCase();var _29;if($(this).hasClass("flash")){var _2a="";$(_2a).appendTo("#"+_17.popupId+"_inner");if(cw==0){cw=600;}if(ch==0){ch=400;}_1f=true;}else{if(_28==".jpg"||_28==".jpeg"||_28==".gif"||_28==".png"||_28==".bmp"){var img=new Image();$(img).error(function(){_25();}).appendTo("#"+_17.popupId+"_inner");img.onload=function(){_21();_1f=false;img.onload=function(){};};img.src=_27+"?"+(new Date()).getTime()+" ="+(new Date()).getTime();}else{if(_27.charAt(0)=="#"){_19=$(_27).get(0);_1b=$(_19).is(":visible");_1a=$(_19).parent();if(_1b){_19=$(_19).clone();}$(_19).removeClass(_17.hiddenClass).appendTo("#"+_17.popupId+"_inner").show();_1f=true;}else{$("