// Input 0
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 f=a.contentsource[1];b.onreadystatechange=function(){featuredcontentslider.ajaxpopulate(b,a)};document.getElementById(a.id).innerHTML=this.ajaxloadingmsg;var g=!this.bustajaxcache?"":f.indexOf("?")!=-1?"&"+(new Date).getTime():"?"+(new Date).getTime();b.open("GET",f+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="",f=a.toc,g=a.nextprev;if(typeof f=="string"&&f!="markup"||typeof f=="object"){for(var e=1;e<=a.contentdivs.length;e++)d+='<a href="#'+e+'" class="toc">'+(typeof f=="string"?f.replace(/#increment/,
e):f[e-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(e=f=0;e<d.length;e++)if(this.css(d[e],"toc","check"))if(f>a.contentdivs.length-1)d[e].style.display="none";else{d[e].setAttribute("rel",++f);d[e][a.revealtype]=function(){featuredcontentslider.turnpage(a,this.getAttribute("rel"));return false};a.toclinks.push(d[e])}else if(this.css(d[e],"prev","check")||this.css(d[e],
"next","check"))d[e].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,f=a.contentdivs.length;b=/prev/i.test(b)?d-1:/next/i.test(b)?d+1:parseInt(b);b=b<1?f:b>f?1:b;if(!(b==a.currentpage&&typeof c=="undefined")){a.currentpage=b;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])if(typeof c.filters[0].opacity=="number")c.filters[0].opacity=b*100;else 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);if(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 if(c=="remove")a.className=a.className.replace(d,"");else if(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");if(document.cookie.match(a))return document.cookie.match(a)[0].split("=")[1];
return 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)}};
