<!-- Hide script from older browsers

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/ Copyright 2001-3 by Sharon Paine See Terms of Use at http://www.dyn-web.com/bus/terms.html regarding conditions under which you may use this code.This notice must be retained in the code as is!
*************************************************************************/

var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

var contractsymbol='<img src="images/ropen.gif">&nbsp;' //HTML for contract symbol. 
var expandsymbol='<img src="images/rclosed.gif">&nbsp;' //HTML for expand symbol.


if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(rootobj, classname){
var temparray=new Array()
var inc=0
for (i=0; i<rootobj.length; i++){
if (rootobj[i].className==classname)
temparray[inc++]=rootobj[i]
}
return temparray
}


function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(curobj, cid){
var spantags=curobj.getElementsByTagName("SPAN")
var showstateobj=getElementbyClass(spantags, "showstate")
if (ccollect.length>0){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
if (showstateobj.length>0){ //if "showstate" span exists in header
if (collapseprevious=="no")
showstateobj[0].innerHTML=(document.getElementById(cid).style.display=="block")? contractsymbol : expandsymbol
else
revivestatus()
}
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function revivestatus(){
var inc=0
while (statecollect[inc]){
if (ccollect[inc].style.display=="block")
statecollect[inc].innerHTML=contractsymbol
else
statecollect[inc].innerHTML=expandsymbol
inc++
}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
var alltags=document.all? document.all : document.getElementsByTagName("*")
ccollect=getElementbyClass(alltags, "switchcontent")
statecollect=getElementbyClass(alltags, "showstate")
if (enablepersist=="on" && ccollect.length>0){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
if (ccollect.length>0 && statecollect.length>0)
revivestatus()
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

// Add your image names here 
/////////////////////////////////////////////////////////////////////
// image file names go in these arrays
randImgObj.set1 = new Array("imagerot_01_001.jpg", "imagerot_01_002.jpg", "imagerot_01_003.jpg", "imagerot_01_004.jpg", "imagerot_01_005.jpg", "imagerot_01_006.jpg", "imagerot_01_048.jpg");

// for the second set of rotating images 
randImgObj.set2 = new Array("imagerot_01_007.jpg", "imagerot_01_008.jpg", "imagerot_01_009.jpg", "imagerot_01_010.jpg", "imagerot_01_011.jpg", "imagerot_01_012.jpg", "imagerot_01_049.jpg");

// for the third set of rotating images 
randImgObj.set3 = new Array("imagerot_01_013.jpg", "imagerot_01_014.jpg", "imagerot_01_015.jpg", "imagerot_01_016.jpg", "imagerot_01_017.jpg", "imagerot_01_018.jpg", "imagerot_01_050.jpg");

// for the fourth set of rotating images 
randImgObj.set4 = new Array("imagerot_01_019.jpg", "imagerot_01_020.jpg", "imagerot_01_021.jpg", "imagerot_01_021.jpg", "imagerot_01_022.jpg", "imagerot_01_023.jpg", "imagerot_01_051.jpg");

// for the fifth set of rotating images 
randImgObj.set5 = new Array("imagerot_01_024.jpg", "imagerot_01_025.jpg", "imagerot_01_026.jpg", "imagerot_01_027.jpg", "imagerot_01_028.jpg", "imagerot_01_029.jpg", "imagerot_01_052.jpg");

// for the sixth set of rotating images 
randImgObj.set6 = new Array("imagerot_01_030.jpg", "imagerot_01_031.jpg", "imagerot_01_032.jpg", "imagerot_01_033.jpg", "imagerot_01_034.jpg", "imagerot_01_035.jpg", "imagerot_01_053.jpg");

// for the seventh set of rotating images 
randImgObj.set7 = new Array("imagerot_01_036.jpg", "imagerot_01_037.jpg", "imagerot_01_038.jpg", "imagerot_01_039.jpg", "imagerot_01_040.jpg", "imagerot_01_041.jpg", "imagerot_01_054.jpg");

// for the second set of rotating images 
randImgObj.set8 = new Array("imagerot_01_042.jpg", "imagerot_01_043.jpg", "imagerot_01_044.jpg", "imagerot_01_045.jpg", "imagerot_01_046.jpg", "imagerot_01_047.jpg", "imagerot_01_055.jpg");

// If all the images you wish to display are in the same location, you can specify the path here 
randImgObj.imagesPath = "images/";

// No need to edit code below this line 
/////////////////////////////////////////////////////////////////////
Array.prototype.shuffle = function() { 
  var i, temp, i1, i2;
  for (i=0; i<this.length; i++) { 
    i1 = Math.floor( Math.random() * this.length );
    i2 = Math.floor( Math.random() * this.length );
    temp = this[i1];
    this[i1] = this[i2];
    this[i2] = temp;
  }
}

randImgObjs = []; // holds all random rotating image objects defined
// constructor 
function randImgObj(s) {
  this.speed=s; this.ctr=0; this.timer=0;  
  this.index = randImgObjs.length; randImgObjs[this.index] = this;
  this.animString = "randImgObjs[" + this.index + "]";
}

randImgObj.prototype = {
  addImages: function(ar) { // preloads images
    this.imgObj.imgs = [];
    for (var i=0; ar[i]; i++) {
      this.imgObj.imgs[i] = new Image();
      this.imgObj.imgs[i].src = randImgObj.imagesPath + ar[i];
    }
  },

  rotate: function() { // controls rotation
    var ctr = Math.floor( Math.random() * this.imgObj.imgs.length );
    if (ctr == this.ctr) ctr = (ctr > 0)? --ctr: ++ctr;
    this.ctr = ctr;
    if ( typeof this.imgObj.filters != "undefined" ) {
   		this.imgObj.style.filter = 'blendTrans(duration=1)';
      if (this.imgObj.filters.blendTrans) this.imgObj.filters.blendTrans.Apply();
    }
    this.imgObj.src = this.imgObj.imgs[this.ctr].src;
    if ( typeof this.imgObj.filters != "undefined" && this.imgObj.filters.blendTrans )
      this.imgObj.filters.blendTrans.Play();    
  }
}

// sets up rotation for all defined randImgObjs
randImgObj.start = function() {
  for (var i=0; i<randImgObjs.length; i++) 
    randImgObjs[i].timer = setInterval(randImgObjs[i].animString + ".rotate()", randImgObjs[i].speed);                     
}

// border set to 0
randImgObj.setUpImg = function(imgAr, sp, w, h) {
  var rotator, img, imgStr = "";
  rotator = new randImgObj(sp);
  randImgObjs[randImgObjs.length-1].imgAr = imgAr;
  imgAr.shuffle();
  img = imgAr[ Math.floor( Math.random() * imgAr.length ) ]; 
  imgStr += '<img src="' + randImgObj.imagesPath + img + '" border="0" ';
  imgStr += 'name="img' + (randImgObjs.length-1) + '" width="' + w + '" height="' + h + '">';
  document.write(imgStr); 
}

function initRandRotation() {
  for (var i=0; randImgObjs[i]; i++) {
    var rotator = randImgObjs[i];
    rotator.imgObj = document.images["img" + i]; // get reference to the image object
    rotator.addImages(rotator.imgAr);
    rotator.rotate();
  }
  randImgObj.start();  
}

// End hiding the script -->