//*	DOM Image rollover: by Chris Poole; http://chrispoole.com
//* Script featured on http://www.dynamicdrive.com 
function init() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');
            this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',imgOriginSrc)
        }
    }
  }
}
onload=init;



/// Mini Preloader 
function preloader() 
{
     // counter
	 var i = 0;
     // create object
	 imageObj = new Image();
     // set image list
	 images = new Array();     
	 images[0]="vica_v5_header.jpg"
	 images[1]="vica_v5_header_bg.jpg" 
	 images[2]="frame_deco.gif" 
	 images[3]="footer_deco.gif"
	 images[4]="side_deco.gif"
	 images[5]="fullview_norm.gif.gif"
	 images[6]="fullview_hover.gif"
     // start preloading 
	 for(i=0; i<=5; i++)
	 {          
	 	imageObj.src=images[i];
		}

} 




// Days of the week 
var this_weekday_name_array = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")	//predefine weekday names
var this_month_name_array = new Array("January","February","March","April","May","June","July","August","September","October","November","December")	//predefine month names

var this_date_timestamp=new Date()	//get current day-time stamp

var this_weekday = this_date_timestamp.getDay()	//extract weekday
var this_date = this_date_timestamp.getDate()	//extract day of month

var this_dateSuffix = "";	//add th after date
if (this_date > 3){
    this_dateSuffix = "th";
}
if (this_date == 3){
    this_dateSuffix = "rd";
}
if (this_date == 2){
    this_dateSuffix = "nd";
}
if (this_date == 1){
    this_dateSuffix = "st";
}
if (this_date == 21){
    this_dateSuffix = "st";
}
if (this_date == 22){
    this_dateSuffix = "nd";
}
if (this_date == 23){
    this_dateSuffix = "rd";
}
if (this_date == 31){
    this_dateSuffix = "st";
}

var this_month = this_date_timestamp.getMonth()	//extract month
var this_year = this_date_timestamp.getYear()	//extract year

if (this_year < 1000)
	this_year+= 1900;	//fix Y2K problem
if (this_year==101)
	this_year=2001;		//fix Netscape browsers - it displays the year as being the year 101!

var this_date_string = this_weekday_name_array[this_weekday] + " " + this_month_name_array[this_month] + " " + this_date + this_dateSuffix + ", " + this_year + " " //concat long date string





// Original:  Craig Lumley 
// Web Site:  http://www.ws4all.co.uk
function MakeArrayday(size) {
this.length = size;
for(var i = 1; i <= size; i++) {
this[i] = "";
}
return this;
}
function MakeArraymonth(size) {
this.length = size;
for(var i = 1; i <= size; i++) {
this[i] = "";
}
return this;
}
function funClock() {
if (!document.layers && !document.all)
return;
var runTime = new Date();
var hours = runTime.getHours();
var minutes = runTime.getMinutes();
var seconds = runTime.getSeconds();
var dn = "AM";
if (hours >= 12) {
dn = "PM";
hours = hours - 12;
}
if (hours == 0) {
hours = 12;
}
if (minutes <= 9) {
minutes = "0" + minutes;
}
if (seconds <= 9) {
seconds = "0" + seconds;
}
movingtime = hours + ":" + minutes + ":" + seconds + " " + dn;
if (document.layers) {
document.layers.clock.document.write(movingtime);
document.layers.clock.document.close();
}
else if (document.all) {
clock.innerHTML = movingtime;
}
setTimeout("funClock()", 1000)
}
window.onload = funClock;

