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