function show_this(id){
var element_visible = document.getElementById(id).style.display;
switch(element_visible){
case 'none':
document.getElementById(id).style.display = 'block';
break
default:
document.getElementById(id).style.display = 'none';
break
}
}
function admin_toggle_menu() {
var obj = document.getElementById('admin_menu_inside').style.display;
switch(obj){
case 'none':
document.getElementById('admin_menu_inside').style.display = 'block';
break;
default:
document.getElementById('admin_menu_inside').style.display = 'none';
break;
}
}
//** Featured Content Slider script- ? Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Last updated: Feb 28th- 07- Added ability to customize pagination links' text
////Ajax related settings
var csbustcachevar=0 //bust potential caching of external pages after initial Ajax request? (1=yes, 0=no)
var csloadstatustext=" Requesting content..." //HTML to indicate Ajax page is being fetched
var csexternalfiles=[] //External .css or .js files to load to style the external content(s), if any. Separate multiple files with comma ie: ["cat.css", dog.js"]
////NO NEED TO EDIT BELOW////////////////////////
var enablepersist=true
var slidernodes=new Object() //Object array to store references to each content slider's DIV containers (
)
var csloadedobjects="" //Variable to store file names of .js/.css files already loaded (if Ajax is used)
function ContentSlider(sliderid, autorun, customPaginateText, customNextText){
var slider=document.getElementById(sliderid)
if (typeof customPaginateText!="undefined" && customPaginateText!="") //Custom array of pagination links text defined?
slider.paginateText=customPaginateText
if (typeof customNextText!="undefined" && customNextText!="") //Custom HTML for "Next" link defined?
slider.nextText=customNextText
slidernodes[sliderid]=[] //Array to store references to this content slider's DIV containers (
)
ContentSlider.loadobjects(csexternalfiles) //Load external .js and .css files, if any
var alldivs=slider.getElementsByTagName("div")
for (var i=0; i
0) //if autorun parameter (int_miliseconds) is defined, fire auto run sequence
window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid, autorun)}, autorun)
}
ContentSlider.buildpagination=function(sliderid){
var slider=document.getElementById(sliderid)
var paginatediv=document.getElementById("paginate-"+sliderid) //reference corresponding pagination DIV for slider
var pcontent=""
for (var i=0; i'+(slider.paginateText? slider.paginateText[i] : i+1)+''
//pcontent+=''
pcontent+=''
pcontent+=''
pcontent+=''
paginatediv.innerHTML=pcontent
paginatediv.onclick=function(){ //cancel auto run sequence (if defined) when user clicks on pagination DIV
if (typeof window[sliderid+"timer"]!="undefined")
clearTimeout(window[sliderid+"timer"])
}
}
ContentSlider.turnpage=function(sliderid, thepage){
var paginatelinks=document.getElementById("paginate-"+sliderid).getElementsByTagName("a") //gather pagination links
for (var i=0; i' //empty corresponding pagination link's class name
paginatelinks[i].className=''
slidernodes[sliderid][i].style.display="none" //hide DIV
}
paginatelinks[thepage].className="selected" //for selected DIV, set corresponding pagination link's class name
slidernodes[sliderid][thepage].style.display="block" //show selected DIV
//Set "Next" pagination link's (last link within pagination DIV) "rel" attribute to the next DIV number to show
paginatelinks[paginatelinks.length-1].setAttribute("rel", thenextpage=(thepage0)? thepage-1 : paginatelinks.length-4)
if (enablepersist)
setCookie(sliderid, sliderid+":"+thepage)
}
ContentSlider.autoturnpage=function(sliderid, autorunperiod){
var paginatelinks=document.getElementById("paginate-"+sliderid).getElementsByTagName("a") //Get pagination links
var nextpagenumber=parseInt(paginatelinks[paginatelinks.length-1].getAttribute("rel"))//Get page number of next DIV to show
var prevpagenumber=parseInt(paginatelinks[paginatelinks.length-2].getAttribute("rel"))
ContentSlider.turnpage(sliderid, nextpagenumber) //Show that DIV
window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid, autorunperiod)}, autorunperiod)
}
function getCookie(Name){
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}
function setCookie(name, value){
document.cookie = name+"="+value
}
////////////////Ajax Related functions //////////////////////////////////
ContentSlider.ajaxpage=function(url, thediv){
var page_request = false
var bustcacheparameter=""
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
thediv.innerHTML=csloadstatustext
page_request.onreadystatechange=function(){
ContentSlider.loadpage(page_request, thediv)
}
if (csbustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET.html', url+bustcacheparameter, true)
page_request.send(null)
}
ContentSlider.loadpage=function(page_request, thediv){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
thediv.innerHTML=page_request.responseText
}
ContentSlider.loadobjects=function(externalfiles){ //function to load external .js and .css files. Parameter accepts a list of external files to load (array)
for (var i=0; iMapa element_visiblefunctionshow_this(id){ ContentSlider.loadobjects(csexternalfiles)file=externalfiles[i]false Requestinglinks'number multiplelinkpage true;window[sliderid+"timer"]!="undefined")paginatelinks[i].className='' defined)DIV//for foundpaginationaccepts page_requestcontainersSlider 'block';script-name+"="+value fileref.setAttribute("type",clearTimeout(window[sliderid+"timer"])var paginationthediv)(var alldivs=slider.getElementsByTagName("div")csloadstatustext="customNextText){