var featuredcontentslider={ajaxloadingmsg:'<div style="margin: 20px 0 0 20px"><img src="loading.gif" /> Fetching slider Contents. Please wait...</div>',bustajaxcache:true,enablepersist:true,settingcaches:{},jumpTo:function(a,b){this.turnpage(this.settingcaches[a],b)},ajaxconnect:function(a){var b=false;if(window.ActiveXObject)try{b=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{b=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){}}else if(window.XMLHttpRequest)b=new XMLHttpRequest;else return false;
var e=a.contentsource[1];b.onreadystatechange=function(){featuredcontentslider.ajaxpopulate(b,a)};document.getElementById(a.id).innerHTML=this.ajaxloadingmsg;var g=!this.bustajaxcache?"":e.indexOf("?")!=-1?"&"+(new Date).getTime():"?"+(new Date).getTime();b.open("GET",e+g,true);b.send(null)},ajaxpopulate:function(a,b){if(a.readyState==4&&(a.status==200||window.location.href.indexOf("http")==-1))document.getElementById(b.id).innerHTML=a.responseText,this.buildpaginate(b)},buildcontentdivs:function(a){for(var b=
document.getElementById(a.id).getElementsByTagName("div"),c=0;c<b.length;c++)if(this.css(b[c],"contentdiv","check"))a.contentdivs.push(b[c]),b[c].style.display="none"},buildpaginate:function(a){this.buildcontentdivs(a);var b=document.getElementById(a.id),c=document.getElementById("paginate-"+a.id),d="",e=a.toc,g=a.nextprev;if(typeof e=="string"&&e!="markup"||typeof e=="object"){for(var f=1;f<=a.contentdivs.length;f++)d+='<a href="#'+f+'" class="toc">'+(typeof e=="string"?e.replace(/#increment/,f):
e[f-1])+"</a> ";d=(g[0]!=""?'<a href="#prev" class="prev">'+g[0]+"</a> ":"")+d+(g[1]!=""?'<a href="#next" class="next">'+g[1]+"</a>":"");c.innerHTML=d}d=c.getElementsByTagName("a");for(f=e=0;f<d.length;f++)if(this.css(d[f],"toc","check"))e>a.contentdivs.length-1?d[f].style.display="none":(d[f].setAttribute("rel",++e),d[f][a.revealtype]=function(){featuredcontentslider.turnpage(a,this.getAttribute("rel"));return false},a.toclinks.push(d[f]));else if(this.css(d[f],"prev","check")||this.css(d[f],"next",
"check"))d[f].onclick=function(){featuredcontentslider.turnpage(a,this.className);return false};this.turnpage(a,a.currentpage,true);if(a.autorotate[0])c[a.revealtype]=function(){featuredcontentslider.cleartimer(a,window["fcsautorun"+a.id])},b.onclick=function(){featuredcontentslider.cleartimer(a,window["fcsautorun"+a.id])},a.autorotate[1]+=1/a.enablefade[1]*50,this.autorotate(a)},urlparamselect:function(a){return window.location.search.match(RegExp(a+"=(\\d+)","i"))==null?null:parseInt(RegExp.$1)},
turnpage:function(a,b,c){var d=a.currentpage,e=a.contentdivs.length,b=/prev/i.test(b)?d-1:/next/i.test(b)?d+1:parseInt(b),b=b<1?e:b>e?1:b;if(!(b==a.currentpage&&typeof c=="undefined")){a.currentpage=b;if(b==1&&a.topzindex>100)for(c=a.topzindex=0;c<e;c++)a.contentdivs[c].style.zIndex=++a.topzindex;a.contentdivs[b-1].style.zIndex=++a.topzindex;this.cleartimer(a,window["fcsfade"+a.id]);a.cacheprevpage=a.prevpage;if(a.enablefade[0]==true)a.curopacity=0,this.fadeup(a);if(a.enablefade[0]==false)a.contentdivs[a.prevpage-
1].style.display="none",a.onChange(a.prevpage,a.currentpage);a.contentdivs[b-1].style.visibility="visible";a.contentdivs[b-1].style.display="block";a.prevpage<=a.toclinks.length&&this.css(a.toclinks[a.prevpage-1],"selected","remove");b<=a.toclinks.length&&this.css(a.toclinks[b-1],"selected","add");a.prevpage=b;this.enablepersist&&this.setCookie("fcspersist"+a.id,b)}},setopacity:function(a,b){var c=a.contentdivs[a.currentpage-1];if(c.filters&&c.filters[0])typeof c.filters[0].opacity=="number"?c.filters[0].opacity=
b*100:c.style.filter="alpha(opacity="+b*100+")";else if(typeof c.style.MozOpacity!="undefined")c.style.MozOpacity=b;else if(typeof c.style.opacity!="undefined")c.style.opacity=b;a.curopacity=b},fadeup:function(a){if(a.curopacity<1)this.setopacity(a,a.curopacity+a.enablefade[1]),window["fcsfade"+a.id]=setTimeout(function(){featuredcontentslider.fadeup(a)},50);else{if(a.cacheprevpage!=a.currentpage)a.contentdivs[a.cacheprevpage-1].style.display="none";a.onChange(a.cacheprevpage,a.currentpage)}},cleartimer:function(a,
b){if(typeof b!="undefined"&&(clearTimeout(b),clearInterval(b),a.cacheprevpage!=a.currentpage))a.contentdivs[a.cacheprevpage-1].style.display="none"},css:function(a,b,c){var d=RegExp("(^|\\s+)"+b+"($|\\s+)","ig");if(c=="check")return d.test(a.className);else c=="remove"?a.className=a.className.replace(d,""):c=="add"&&(a.className+=" "+b)},autorotate:function(a){window["fcsautorun"+a.id]=setInterval(function(){featuredcontentslider.turnpage(a,"next")},a.autorotate[1])},getCookie:function(a){a=RegExp(a+
"=[^;]+","i");return document.cookie.match(a)?document.cookie.match(a)[0].split("=")[1]:null},setCookie:function(a,b){document.cookie=a+"="+b},init:function(a){var b=this.getCookie("fcspersist"+a.id)||1,c=this.urlparamselect(a.id);this.settingcaches[a.id]=a;a.contentdivs=[];a.toclinks=[];a.topzindex=0;a.currentpage=c||(this.enablepersist?b:1);a.prevpage=a.currentpage;a.revealtype="on"+(a.revealtype||"click");a.curopacity=0;a.onChange=a.onChange||function(){};a.contentsource[0]=="inline"&&this.buildpaginate(a);
a.contentsource[0]=="ajax"&&this.ajaxconnect(a)}};
