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