/***********************************************
* Ajax Rotating Includes script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
***********************************************/
var includefiles=["728x90/uso728-01.html", "728x90/uso728-02.html", "728x90/uso728-03.html", "728x90/uso728-04.html", "728x90/uso728-05.html", "728x90/uso728-06.html", "728x90/uso728-07.html", "728x90/uso728-08.html", "728x90/uso728-09.html", "728x90/uso728-10.html", "728x90/uso728-11.html", "728x90/uso728-12.html", "728x90/uso728-13.html", "728x90/uso728-14.html", "728x90/uso728-15.html", "728x90/uso728-16.html", "728x90/uso728-17.html", "728x90/uso728-18.html", "728x90/uso728-19.html", "728x90/uso728-20.html", "728x90/uso728-21.html", "728x90/uso728-22.html", "728x90/uso728-23.html", "728x90/uso728-24.html", "728x90/uso728-25.html", "728x90/uso728-26.html", "728x90/uso728-27.html", "728x90/uso728-28.html", "728x90/uso728-29.html", "728x90/uso728-30.html", "728x90/uso728-31.html", "728x90/uso728-32.html", "728x90/uso728-33.html", "728x90/uso728-34.html", "728x90/uso728-35.html", "728x90/uso728-36.html", "728x90/uso728-37.html", "728x90/uso728-38.html", "728x90/uso728-39.html", "728x90/uso728-40.html", "728x90/uso728-41.html", "728x90/uso728-42.html", "728x90/uso728-43.html", "728x90/uso728-44.html", "728x90/uso728-45.html"]

var rootdomain="http://"+window.location.hostname

function ajaxinclude(files_array, rotatetype){
var page_request = false
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
var url=choosefile(files_array, rotatetype)
if (typeof files_array[url]=="undefined"){
document.write("Error: No file for this day has been found.")
return
}
else
url=files_array[url]
page_request.open('GET', url, false) //get page synchronously 
page_request.send(null)
writecontent(page_request)
}

function writecontent(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)
document.write(page_request.responseText)
}

function choosefile(files_array, rotatetype){
var today=new Date()
var selectedfile=(rotatetype=="dailyw")? today.getDay() : rotatetype=="dailym"? today.getDate() : Math.floor(Math.random()*files_array.length)
if (rotatetype=="dailyw" && selectedfile==0) //if display type=="week days" and today is Sunday 
selectedfile=7
if (rotatetype=="dailyw" || rotatetype=="dailym")
selectedfile--  //remove 1 to sync with array index
return selectedfile
}
