<!-- Begin hiding script from older browsers

// preload main page image

var aryImages = new Array(2);

  aryImages[0] = "images/main_mx.jpg";
  aryImages[1] = "images/main_ft.jpg";
  aryImages[2] = "images/main_quad.jpg";
  aryImages[1] = "images/main_ft2.jpg";

  for (i=0; i < aryImages.length; i++) {
    var preload = new Image();
    preload.src = aryImages[i];
  }


// date and time........................................

function initArray() {
for(i=0;i<initArray.arguments.length; i++)
this[i] = initArray.arguments[i];}
var isnMonths=new initArray("January","February","March","April","May","June","July","August","September","October","November","December");
var isnDays= new initArray("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
today=new Date();
hrs=today.getHours();
min=today.getMinutes();
sec=today.getSeconds();
clckh=""+((hrs>12)?hrs-12:hrs); 
clckm=((min<10)?"0":"")+min;
clcks=((sec<10)?"0":"")+sec;
clck=(hrs>=12)?"p.m.":"a.m.";
var stnr="";
var ns="0123456789";
var a="";


// history window function...................................

function newWindow(){

historyWin = window.open("tour.htm", "tour", "height=255,width=400,scrollbars=no");
historyWin.focus()

}

// music window function...................................

function playerWindow(url){
var musicWin

if (!musicWin || musicWin.open || musicWin.closed) {

musicWin = window.open(url, "music", "height=46,width=300,scrollbars=no");

}
 if (window.focus) {musicWin.focus()}
 
 else {
musicWin.focus()

 }

}

// music window function...................................

function posterWindowold(img){
posterWin = window.open("poster.htm", "poster", "height=500,width=550,scrollbars=no");
posterWin.focus()

}

// poster viewer function...................................

function templateViewer(val){
leftPos = 0
if (screen) {

leftPos = screen.width-900

}
posterWin = window.open(val, "poster", "height=625,width=850,left="+ leftPos +",top=150,scrollbars=no");
posterWin.focus()

}


function posterWindow(pic){


leftPos = 0
  if (screen) {
     leftPos = screen.width-500
}
  
 
windowOutput = window.open("","output", "height=500,width=550,left="+ leftPos +",top=0,scrollbars=yes")
windowOutput.document.write("<HTML><HEAD><TITLE>Poster Viewer</TITLE></HEAD><BODY bgcolor=#FFFFFF>")
windowOutput.document.write("<table><tr><td><Font face='arial' size='+2' color='#990000'><b>Wallpaper Sample</b></font></td><td align='center'><a href='javascript:close()'><font face='arial' size='2'>Close Window</a></font></td></tr>")
//windowOutput.document.write("<tr><td colspan='2'><img src='"<%Server.URLEncode(pic)%>"'></td></tr>") 
windowOutput.document.write("<tr><td colspan='2'><img src='" + pic + "'></td></tr>") 
windowOutput.document.write("</table></BODY></HTML>")
windowOutput.focus()


 }



// random image rotator.............................................

//mag = new Array("images/btn.rotator.gif","images/rumble.rotator.gif")
//magCt = mag.length

//function randomMag() {
//   if (document.images){
//    randomNum = Math.floor((Math.random()* magCt));
//       document.rotator.src = mag[randomNum]
// }
//}




// featured photo function.........................................

function newWindow2(pic){

leftPos = 0
if (screen) {

leftPos = screen.width-700

}
newsWin = window.open( pic,  "info", "height=560,width=388,left="+ leftPos +",top=0,scrollbars=yes");
newsWin.focus()
}



// featured photo horizontal.........................................

function newWindow3(page){

leftPos = 0
  if (screen) {
    leftPos = screen.width-700

}
newsWin = window.open( page,  "info", "height=388,width=560,left="+ leftPos +",top=0,scrollbars=yes");
newsWin.focus()
}


// displays wallpaper image and download info......................

function wallpaperDemo(pic){


leftPos = 0
  if (screen) {
     leftPos = screen.width-500
}
  
 
windowOutput = window.open("","output", "height=375,width=450,left="+ leftPos +",top=0,scrollbars=yes")
windowOutput.document.write("<HTML><HEAD><TITLE>Wallpaper Download</TITLE></HEAD><BODY bgcolor=#FFFFFF>")
windowOutput.document.write("<table><tr><td><Font face='arial' size='+2' color='#990000'><b>Wallpaper Sample</b></font></td><td align='center'><a href='javascript:close()'><font face='arial' size='2'>Close Window</a></font></td></tr>")
windowOutput.document.write("<tr><td colspan='2'><img src='images/wallpaperdemo/" + pic + ".jpg'></td></tr>") 
windowOutput.document.write("</table></BODY></HTML>")
windowOutput.focus()


 }


// displays wallpaper image and download info......................

function wallpaperWindow(pic){

leftPos = 0
  if (screen) {
     leftPos = screen.width-500
}
windowOutput = window.open("","output", "height=375,width=450,left="+ leftPos +",top=25,scrollbars=yes,resizable=yes")
windowOutput.document.write("<HTML><HEAD><TITLE>Wallpaper Download</TITLE></HEAD><BODY bgcolor=#FFFFFF>")
windowOutput.document.write("<h2>Wallpaper Download</h2>")
windowOutput.document.write("<table><tr><td><img src='images/wallpaper/" + pic + ".jpg'></td></tr><tr><td>") 
windowOutput.document.write("<a href='javascript:close()'><font face='arial' size='2'>Close Window</a></font></td></tr></table>")
windowOutput.document.write("</BODY></HTML>")


}


// dropdown list redirects window...............................


function selectPage(newLoc) {
page=newLoc.options[newLoc.selectedIndex].value

if (page!="")  {

this.location = page

}

  }



// dropdown list opens in new window...............................


function selectNews(newLoc) {
page=newLoc.options[newLoc.selectedIndex].value

if (page!="")  {

newWindow=window.open( page )

}

  }
  
  
// email this page.......................................................


function emailthis(loc){
location.href="mailto:" + "?body=" + loc;

  }



// history window function................................................

pageArray = new Array("","tour1.htm","tour2.htm","tour3.htm","tour4.htm","tour5.htm","tour6.htm","tour7.htm","tour8.htm")

function setPage(thispage){
parent.content.document.location.href= pageArray[thispage]

    }
    
    
// set cookie for vote.....................................................


function checkVote(v) {

expireDate = new Date()
expireDate.setDate(expireDate.getDate()+1);

   
   voteCt = ""
     
if (document.cookie != ""){
voteCt = document.cookie.split("; ")
}
   for (i=0; i<voteCt.length; i++)  {
 
     if (v == voteCt[i].split("=")[1]) {

          alert('You have already voted. Please try again next week.')
      
                 return false
           
           }
      }
      
   
//document.cookie = "voted="+ v +"; expires="+ expireDate.toGMTString();
  
  

  }
  
  
  
  
  function sendVote(v){
  
  expireDate = new Date()
  expireDate.setDate(expireDate.getDate()+30);

  voteCt = ""
  writecookie = "1"   
  results = "-1"
         
    for (i=0; i<document.poll.a.length; i++) {
    
     if (document.poll.a[i].checked) {     
     results = document.poll.a[i].value
   
     
     }
        }
        
  if (results == -1){
  alert("Please make a selection");
  return false
  }
  
      
//remove all the way to document.cookie if doesn't work

   
if (document.cookie != ""){
voteCt = document.cookie.split("; ")
}
   for (i=0; i<voteCt.length; i++)  {
 
     if (v == voteCt[i].split("=")[1]) {

          alert('You have already voted. Please try again next week.')
      
                 return false
           
           }
      }
      
   
document.cookie = "voted="+ v +"; expires="+ expireDate.toGMTString();

 

      voteWin = window.open(location.href="http://www.carlinvilleonline.net/vote/vote.pl?" + "a=" +results+ "&name=first",  "vote", "height=350,width=500,scrollbars=no");
  voteWin.focus()
        
            }
            
 // end cookie and new window
 


// vote results window..............................................................
 
 function voteResults(page){

    resultsWin = window.open(page, "results", "height=350,width=500,scrollbars=no");
    resultsWin.focus()

     }
     
     
 
 
         
//-->






