/***************************************
*    Module: preloader & image rollover
*    Version: 1.0
*    Author: PE
*
*    Description: generic preloader & image
*        rollover function
*
*    Usage:
*        - Call this JS file from whatever
*           an image rollover function is required.
*        - Populate the IMG_NAMES Array with 
*           relevant images.
*        - Call the preloadImages() function
*           ONLY from the homepage. Eliminates
*           likelihood of incorrect pathing (i.e.
*           broken images).
*
*     Change log:
*           - 12-11-2004 - beta version 0.1
*           - 11-11-2005 - version 1.0
*                    - pathing logic removed to make
*                      more generic and reusable.
*
****************************************/

function preloadImages () {
	if (document.images) {
		// add images into this array
		IMG_NAMES = new Array ("images/tab_parent_inactive.jpg", "images/tab_parent_active.jpg", 
			"images/tab_school_inactive.jpg", "images/tab_school_active.jpg");

		rolloverImgs = new Array();

		for (i=0; i<IMG_NAMES.length; i++) {
			rolloverImgs[IMG_NAMES[i]] = new Image();
			rolloverImgs[IMG_NAMES[i]].src = IMG_NAMES[i];
		}
	}
}

function swapImgs(imgName,imgSrc) {
    if (document.images) {
		if (document[imgName]!=null) {
			document[imgName].src = imgSrc;
		} else {
			document.getElementById(imgName).src = imgSrc;
		}
    }
}

// addition Aug05
function changeCopy(highlight,id) {
	var replaceCopy;
	switch(highlight) {
		case "parents":
			replaceCopy = "Wide aisles with supervised activities and entertainment for all ages in a safe environment. Queues are minimal due to the enormous number of activities to choose from. There is a chill-out zone to relax with your child and to let them sleep or watch a movie/video. There are also parents/kids’ change rooms. Most activities are indoors and they run all day, every day.<br><a href=\"parents.asp\" class=\"featurered\">FIND OUT MORE &gt;&gt;</a>";
			//document.getElementById(id).style.borderColor = "#e45052";
			break;
		case "schools":
			replaceCopy = "<img src=\"images/school_sonyTV.jpg\" style=\"float:left; margin-right:10px;\">";
			replaceCopy += "<b>Congratulations to Elanora Heights Primary School</b> and the Children of Class 3D who have won the Sony Grand WEGA TV Entertainment Centre for their school in the 2005 <i>Books on Banners</i> barrel draw for their banner <i>Are We There Yet?</i> <br><a href=\"schools.asp\" class=\"featureorange\">VIEW WINNING BANNER &gt;&gt;</a>";
			//document.getElementById(id).style.borderColor = "#f3ab21";
			break;
		case "sponsors":
			replaceCopy = "<marquee scrolldelay=\"100\">";
			replaceCopy += "<div style=\"white-space:nowrap; height:66px; width:2100px;\">";
			replaceCopy += "<b>Presented By<b><a href=\"asg.asp\"><img src=\"images/ASG_circle.gif\" style=\"border-width:0px; margin-right:35px;\"></a>";
			//replaceCopy += "<b>Supported By</b><a href=\"http://www.midford.com.au\" target=\"_blank\"><img src=\"images/Midford.jpg\" style=\"border-width:0px; padding-top:5px; padding-bottom:5px;\"></a>";
			replaceCopy += "<b>Supported By</b><a href=\"http://www.scholastic.com.au\" target=\"_blank\"><img src=\"images/ReadingRock.jpg\" style=\"border-width:0px;\"></a>";
			replaceCopy += "<a href=\"activefactor.asp\"><img src=\"images/ActiveFactor.jpg\" style=\"border-width:0px; margin-left:35px;\"></a>";
			replaceCopy += "<a href=\"http://www.kidfriendly.com.au/catalog/\" target=\"_blank\"><img src=\"images/KidsFriendly.jpg\" style=\"border-width:0px; margin-left:35px;\"></a>";
			replaceCopy += "<a href=\"http://www.nswscouts.com.au\" target=\"_blank\"><img src=\"images/scouts_66.jpg\" style=\"border-width:0px; margin-left:35px;\"></a>";
			replaceCopy += "<a href=\"http://www.therainbowfairies.com.au\" target=\"_blank\"><img src=\"images/faries_137.jpg\" style=\"border-width:0px; margin-left:35px;\"></a>";
			replaceCopy += "<a href=\"koorikids.asp\"><img src=\"images/koori_kids_logo_146.jpg\" style=\"border-width:0px; margin-left:35px;\"></a>";
			replaceCopy += "<a href=\"http://www.springfreetrampolines.com.au\" target=\"_blank\"><img src=\"images/springfree_logo.gif\" style=\"border-width:0px; margin-left:35px;\"></a>";
			replaceCopy += "<a href=\"http://www.sydneyschild.com.au\" target=\"_blank\"><img src=\"images/sydneyschild_logo.gif\" style=\"border-width:0px; margin-left:35px; padding-top:15px; padding-bottom:15px;\"></a>";
			replaceCopy += "<a href=\"http://www.peglearning.com\" target=\"_blank\"><img src=\"images/peg_95.jpg\" style=\"border-width:0px; margin-left:35px; padding-top:15px; padding-bottom:15px;\"></a>";
			replaceCopy += "<a href=\"http://www.idealcreations.com.au\" target=\"_blank\"><img src=\"images/idealcreations_banner.gif\" style=\"border-width:0px; margin-left:35px; padding-top:8px; padding-bottom:6px;\"></a>";
			replaceCopy += "<a href=\"http://www.organisedkaos.com.au\" target=\"_blank\"><img src=\"images/kaos4kids_banner_106.gif\" style=\"border-width:0px; margin-left:35px;\"></a>";
			replaceCopy += "<a href=\"http://www.bbf.org.au/home1.asp\" target=\"_blank\"><img src=\"images/bonniebabes_67.gif\" style=\"border-width:0px; margin-left:35px;\"></a>";
			replaceCopy += "</div>";
			replaceCopy += "</marquee>";
			replaceCopy += "<div><a href=\"partners.asp\" class=\"featurered\">ALL SUPPORTERS &gt;&gt;</a></div>";
			break;
		case "volunteers":
			//replaceCopy = "If you love working with Kids, getting your hands dirty and having a great time then volunteering at Kids Universe is for you. <br><br>We have made it easy! <br><br><a href=\"volunteers.asp\" class=\"featurered\">REGISTER NOW &gt;&gt;</a>";
			replaceCopy = "We would like to say <b>thank you</b> to all of our dedicated volunteers for helping to make <b>Kids Universe</b> so memorable. <br>";
			break;
		case "stars":
			replaceCopy = "See your favourite stars with great shows all day, everyday.";
			break;
		case "read":
			replaceCopy = "Get hooked on books.";
			break;
		case "clubku":
			replaceCopy = "Join Club KU for all the latest news, updates &amp; great prizes.";
			break;
		case "activities":
			replaceCopy = "Activities that let you create play, feast, dream &amp; move.";
			break;
		default:

	}
	document.getElementById(id).innerHTML = replaceCopy;
}