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