<!--

var hpPic = "hp_pic_01.jpg"; {
	num = Math.floor(Math.random()*9);
	if (num == 0) {
		hpPic = "hp_pic_01.jpg";
	}
	else if (num == 1) {
		hpPic = "hp_pic_02.jpg";
	}
	else if (num == 2) {
		hpPic = "hp_pic_03.jpg";
	}
	else if (num == 3) {
		hpPic = "hp_pic_04.jpg";
	}
	else if (num == 4) {
		hpPic = "hp_pic_05.jpg";
	}
	else if (num == 5) {
		hpPic = "hp_pic_06.jpg";
	}
	else if (num == 6) {
		hpPic = "hp_pic_07.jpg";
	}
	else if (num == 7) {
		hpPic = "hp_pic_08.jpg";
	}
	else if (num == 8) {
		hpPic = "hp_pic_09.jpg";
	}
}

function Clear(theText) {
	if (theText.value == theText.defaultValue) {
	theText.value = ""
	}
}	

function isBlank() {
	value=document.searchform.elements['SearchString'].value;
	if ( value == "" ){
        	alert("Please enter search word");
        	return false;
    	}
	else if ( value == "Search..." ){
        	alert("Please enter search word");
        	return false;
    	}
    	else {
    		return true;
    	}
}

// ----------------------------------------------

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function toggleStyleSheet() {
	if (getActiveStyleSheet() == "default") {
		setActiveStyleSheet("increased", 1);
	} else {
		setActiveStyleSheet("default", 1);
	}
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(31*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  if(cookie=="null") {
    var title = getPreferredStyleSheet(); 
  } else {
    var title = cookie ? cookie : getPreferredStyleSheet();
  }    
    setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

// ----------------------------------------------

function openWindow(URL,name,features) {
	window.open(URL,name,features);
}

function closeWindow() {
	window.close();
}

function email() {
	document.write('<a href="mailto:info@wodonga.vic.gov.au">info@wodonga.vic.gov.au</a>');
}

var date = new Date();
var year = date.getFullYear();

function lastModified() {
	var date = new Date(document.lastModified);
	var day = date.getDate();
	var month = [date.getMonth() + 1];
	var year = date.getYear();
	if (day < 10) day = "0" + day;
	if (month < 10) month = "0" + month;
	if (year < 2000) year += 1900;
	document.write(day + "-" + month + "-" + year);
}

function credit() {
	document.write('<a href="http://www.gocreative.com" class="credit">Site powered by Gocreative<img src="/assets/images/powered_by.gif" alt="Site powered by Gocreative ContentContributor" height="11" width="135" border="0" align="texttop" /></a>');
}

//-->
