﻿/*
* Accordion Gallery version 1.0.5
* Copyright 2010, FLComponents http://wwww.flcomponents.net
* licensed according to purchased license
* Date: Fri Jun 18 16:24:00
*/

function FLCObject(){}FLCObject.prototype.Render=function(a,b){$(a).append(b.Definition)};function Element(){this.Definition=null;this.Data=null}Element.prototype.AddChild=function(a){this.Definition.append(a.Definition)};Element.prototype.AddAttributesWithValue=function(b,a){this.Definition.attr(b,a)};Element.prototype.AddText=function(a){this.Definition.text(a)};Element.prototype.AddHtml=function(a){this.Definition.html(this.Definition.html()+a)};Element.prototype.AddInlineStyle=function(a,b){this.Definition.css(a,b)};Element.prototype.Html=function(a){this.Definition=$(a)};Element.prototype.Data=function(a){this.Data=a};Div.prototype=new Element;Div.prototype.constructor=Div;function Div(a){this.Definition=$("<div></div>");if(a!="undefined"){}this.Definition.attr("Id",a)}Ul.prototype=new Element;Ul.prototype.constructor=Ul;function Ul(a){this.Definition=$("<ul></ul>");if(this.Id!="undefined"){}this.Definition.attr("Id",a)}Li.prototype=new Element;Li.prototype.constructor=Li;function Li(a){this.Definition=$("<li></li>");if(this.Id!="undefined"){}this.Definition.attr("Id",a)}P.prototype=new Element;P.prototype.constructor=P;function P(a){this.Definition=$("<p></p>");if(this.Id!="undefined"){}this.Definition.attr("Id",a)}Img.prototype=new Element;Img.prototype.constructor=Img;function Img(c,b,a){this.Definition=$("<Img/>");if(this.Id!="undefined"){}this.Definition.attr("Id",c);this.Definition.attr("src",b);this.Definition.attr("alt",a)}A.prototype=new Element;A.prototype.constructor=A;function A(a){this.Definition=$("<a></a>");if(this.Id!="undefined"){}this.Definition.attr("Id",a)}function FLCObject(){}FLCObject.prototype.Render=function(a,b){$(a).append(b.Definition)};function Element(){this.Definition=null}Element.prototype.AddChild=function(a){this.Definition.append(a.Definition)};Element.prototype.AddAttributesWithValue=function(b,a){this.Definition.attr(b,a)};Element.prototype.AddText=function(a){this.Definition.text(a)};Element.prototype.AddHtml=function(a){this.Definition.html(this.Definition.html()+a)};Element.prototype.AddInlineStyle=function(a,b){this.Definition.css(a,b)};Element.prototype.Html=function(a){this.Definition=$(a)};Div.prototype=new Element;Div.prototype.constructor=Div;function Div(a){this.Definition=$("<div></div>");if(a!="undefined"){}this.Definition.attr("Id",a)}Ul.prototype=new Element;Ul.prototype.constructor=Ul;function Ul(a){this.Definition=$("<ul></ul>");if(this.Id!="undefined"){}this.Definition.attr("Id",a)}Li.prototype=new Element;Li.prototype.constructor=Li;function Li(a){this.Definition=$("<li></li>");if(this.Id!="undefined"){}this.Definition.attr("Id",a)}P.prototype=new Element;P.prototype.constructor=P;function P(a){this.Definition=$("<p></p>");if(this.Id!="undefined"){}this.Definition.attr("Id",a)}Img.prototype=new Element;Img.prototype.constructor=Img;function Img(c,b,a){this.Definition=$("<Img/>");if(this.Id!="undefined"){}this.Definition.attr("Id",c);this.Definition.attr("src",b);this.Definition.attr("alt",a)}A.prototype=new Element;A.prototype.constructor=A;function A(a){this.Definition=$("<a></a>");if(this.Id!="undefined"){}this.Definition.attr("Id",a)}YT.prototype=new Element;YT.prototype.constructor=YT;function YT(c,d,b,a){if(typeof a=="undefined"){a=""}if(typeof d=="undefined"){d=640}if(typeof b=="undefined"){b=480}if(typeof c=="undefined"){c="jnEqyBofZzM"}var e='<!--[if IE ]><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  width="'+d+'" height="'+b+'" id="'+a+'"><param name="movie" value="http://www.youtube.com/e/'+c+'?enablejsapi=1&version=3&playerapiid=ytplayer" /><param name="wmode" value="transparent"/><param name="allowScriptAccess" value="always"/><![endif]--><!--[if !IE]>--><object id="'+a+'" type="application/x-shockwave-flash" data="http://www.youtube.com/e/'+c+'?enablejsapi=1&version=3&playerapiid=ytplayer" width="'+d+'" height="'+b+'" allowScriptAccess="always" wmode="transparent"><!--<![endif]--><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a><!--[if !IE]>--></object><!--<![endif]-->';this.Definition=$(e)}SWF.prototype=new Element;SWF.prototype.constructor=SWF;function SWF(e,d,b,a){if(typeof a=="undefined"){a=""}if(typeof d=="undefined"){d=640}if(typeof b=="undefined"){b=480}var c='<!--[if IE ]><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  width="'+d+'" height="'+b+'" id="'+a+'"><param name="movie" value="'+e+'" /><param name="wmode" value="transparent"/><param name="allowScriptAccess" value="always"/><![endif]--><!--[if !IE]>--><object id="'+a+'" type="application/x-shockwave-flash" data="'+e+'" width="'+d+'" height="'+b+'" allowScriptAccess="always" wmode="transparent"><!--<![endif]--><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a><!--[if !IE]>--></object><!--<![endif]-->';this.Definition=$(c)}(function(a){a.fn.FLCAccordion=function(q){var p=a.extend({},a.fn.FLCAccordion.defaults,q);var n="Can not load configuration XML, please check the path.";var g=this.selector;var j=0;var h=false;var r=p.animationTime*1000;jQuery.extend(jQuery.easing,{easeOutBounce:function(w,y,z,B,i){if((y/=i)<(1/2.75)){return B*(7.5625*y*y)+z}else{if(y<(2/2.75)){return B*(7.5625*(y-=(1.5/2.75))*y+0.75)+z}else{if(y<(2.5/2.75)){return B*(7.5625*(y-=(2.25/2.75))*y+0.9375)+z}else{return B*(7.5625*(y-=(2.625/2.75))*y+0.984375)+z}}}},easeInOutBounce:function(D,y,z,B,E){var i=1.70158;var w=0;var C=B;if(y==0){return z}if((y/=E/2)==2){return z+B}if(!w){w=E*(0.3*1.5)}if(C<Math.abs(B)){C=B;var i=w/4}else{i=w/(2*Math.PI)*Math.asin(B/C)}if(y<1){return -0.5*(C*Math.pow(2,10*(y-=1))*Math.sin((y*E-i)*(2*Math.PI)/w))+z}return C*Math.pow(2,-10*(y-=1))*Math.sin((y*E-i)*(2*Math.PI)/w)*0.5+B+z}});accordion=new Div("container");accordion.AddInlineStyle("position","relative");ul=new Ul();accordion.AddChild(ul);var e=null;var d=0;var k;if(p.htmlConfig==true){e=a(g+" ul");k=a(e).find("li").length;l(e)}else{a.ajax({type:"GET",url:p.assetsPath+"/data.xml",dataType:"xml",success:function(i){k=a(i).find("li").length;l(a(i))},error:function(i,x,w){alert(n)}})}function l(i){i.find("li").each(function(){var C;var B;var y;var x;var w;C=jQuery.trim(a(this).find("img").attr("src"));if(p.htmlConfig){B=a.trim(a(this).find('p[pos="left"]').html());y=a.trim(a(this).find('p[pos="bottom"]').html());x=a.trim(a(this).find('a[name="link"]').html())}else{B=a(this).find('p[pos="left"]').text();y=a(this).find('p[pos="bottom"]').text();x=a(this).find('a[name="link"]').text()}w=jQuery.trim(a(this).find('a[name="link"]').attr("target"));li=new Li();ul.AddChild(li);divTitle=new Div();divTitle.AddAttributesWithValue("class","title");divTitle.AddHtml(B);if(p.showLeftText==true){li.AddChild(divTitle)}divItem=new Div();divItem.AddAttributesWithValue("class","item");li.AddChild(divItem);divBottomText=new Div();divBottomText.AddAttributesWithValue("class","bottom-text");divBottomText.AddHtml(y);if(p.showBottomText==true){divItem.AddChild(divBottomText)}image=new Img();image.AddAttributesWithValue("src",C);if(x!=""){var z=new A();z.AddAttributesWithValue("href",x);if(w!="undefined"&&w!=""){z.AddAttributesWithValue("target",w)}divItem.AddChild(z);z.AddChild(image)}else{divItem.AddChild(image)}if(d==k-1){li.AddAttributesWithValue("class","last");li.AddInlineStyle("border-right","none")}d++});s(k)}function s(w){var x=(p.galleryWidth/w)-1;j=(p.galleryWidth-p.pictureWidth)/(w-1)-1;var i="";if(p.showIcon){i='background:transparent url("'+p.iconPath+'") no-repeat 5px 4px; '}var y='<style type="text/css">'+g+" .title{ "+i+" width:"+p.galleryHeight+"px;height:30px;background-color:"+p.leftTextBgColor+';-moz-transform-origin:0 0;-webkit-transform-origin:0 0;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);color:#fff;font-size:17px;text-align:center;vertical-align:middle;position:absolute;bottom:-30px;left:0;line-height:30px;font-family:Arial}</style><!--[if IE]><style type="text/css"> .title {top:0;filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);}</style><![endif]--> <style type="text/css"> '+g+"{position:relative;width:"+p.galleryWidth+"px;height:"+p.galleryHeight+"px;background-color:"+p.bgColor+";font-size:18px;overflow:hidden}"+g+" ul{width:"+p.galleryWidth+"px;height:"+p.galleryHeight+"px;margin:0;padding:0}"+g+" li{float:left;height:"+p.galleryHeight+"px;width:"+x+"px;list-style:none;border-right:solid 1px "+p.borderColor+";position:relative;overflow:hidden}"+g+" li .item{height:"+p.galleryHeight+"px;width:"+p.pictureWidth+"px;position:absolute}"+g+" li img{height:"+p.galleryHeight+"px;width:"+p.pictureWidth+"px; border-width:0;}.last{overflow:visible!important;overflow-x:visible!important;overflow-y:visible!important}"+g+" .bottom-text{background-color:"+p.bottomTextBgColor+";width:"+(p.pictureWidth-20)+"px;padding:5px 10px 5px 10px; text-align:justify;font-family:Arial;color:#fff;font-weight:400;font-size:12px;position:absolute;bottom:-100px}</style>";a("head").append(y);if(e!=null){e.remove()}fl=new FLCObject();fl.Render(g,accordion);if(p.code!="317869xas"){a(g).append("<div style='position:absolute; top:10px; left:10px; font-family:Arial; font-size:12px;'><a style='color:white; text-decoration:none;' href='http://flcomponents.net/Components/Item/JQuery_Accordion_Gallery'>Buy this plugin<a/></div>")}a(g+" .item").fadeTo(0,p.imagesOpacity,function(){});a(g+" .bottom-text").fadeTo(0,p.bottomTextOpacity,function(){});if(!p.autoPlay){u(g,x)}else{a(g+" ").mouseenter(function(){h=true;p.autoPlay=false;u(g)});a(g+" ").mouseleave(function(){h=false;p.autoPlay=true})}}function u(i,w){if(p.eventType=="over"){a(i+"  li").mouseenter(function(){b(i,this)})}if(p.eventType=="click"){a(i+"  li").click(function(){b(i,this)})}a(i+"  .item").mouseenter(function(){t(this)});a(i+" ").mouseleave(function(){a(i+"  li").animate({width:w},{duration:r,queue:false,easing:"swing",complete:function(){}})});a(i+"  .item").mouseleave(function(){f(this)})}function b(i,w){var x=w;a(i+"  li").animate({width:j},{duration:r,queue:false,easing:"swing",complete:function(){}});a(x).find(".bottom-text").animate({bottom:10},{duration:1200,queue:false,easing:"easeInOutBounce"});a(x).animate({width:p.pictureWidth},{duration:r,queue:false,easing:"swing",complete:function(){}})}function t(i){var w=i;a(w).fadeTo(r,1,function(){a(w).clearQueue()})}function f(i){var w=i;a(w).find(".bottom-text").animate({bottom:-a(w).find(".bottom-text").height()-15},{duration:1200,queue:false,easing:"easeInOutBounce"});a(w).fadeTo(r,p.imagesOpacity,function(){a(w).clearQueue()})}var m=0;var v=a(g+"  li");var c=a(g+"  .item");function o(){if(!h){if(p.switchOrder=="ltr"){if(m!=0){f(c[m-1])}else{f(c[k-1])}b(g,v[m]);t(c[m]);m++;if(m==k){m=0}}if(p.switchOrder=="rtl"){m++;if(m!=1){f(c[k-m+1])}else{f(c[0])}b(g,v[k-m]);t(c[k-m]);if(m==k){m=0}}}setTimeout(o,p.switchTime*1000)}if(p.autoPlay){o()}};a.fn.FLCAccordion.defaults={galleryWidth:600,galleryHeight:400,pictureWidth:300,bgColor:"#000000",leftTextBgColor:"#222",bottomTextBgColor:"#333333",borderColor:"#9999aa",imagesOpacity:0.5,bottomTextOpacity:0.6,eventType:"over",showLeftText:true,showBottomText:true,animationTime:0.6,assetsPath:"assets",htmlConfig:true,autoPlay:false,switchTime:2,switchOrder:"ltr",showIcon:true,iconPath:"assets/arr.png",code:""}})(jQuery);
