﻿
function popup(url){
	window.open(url, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=466,height=716');
}

function popup2(url){
	window.open(url, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=616,height=566');
}

function popup3(url){
	window.open(url, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=585');
}

function popup4(url){
	window.open(url, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=500,height=585');
}

function popup5(url){
	window.open(url, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=585');
}

function preloadImages(imgArray){
    if(imgArray.length > 0){
        var images = new Array();
        for(var i=0; i<imgArray.length; i++){            
            images[i] = new Image(); 
		    images[i].src = '../images/' + imgArray[i] + '.jpg';
        }
        return true;
    }
}

function swapImage(element, img, type){
    if (document.getElementById(element)) {        
        switch (type) {
            case 1:
                document.getElementById(element).style.margin = "8px 0 0 8px";
                break;
            case 2:
                document.getElementById(element).style.margin = "8px 0 0 60px";
                break;
            case 3:
                document.getElementById(element).style.margin = "100px 0 0 8px";
                break;
        }
        document.getElementById(element).src = img;
    }
}

function changeGalleryImage(imageHolderId, numImages){
	//THE TWO CALLING ARGUMENTS NEED TO BE STORED LOCALLY TO MAKE THEM AVAILABLE TO THE setTimeout() FUNCTION.
	imageHolderIdTemp = imageHolderId; 
	numImagesTemp = numImages;
	numImages -= 1;
	if(getElement(imageHolderId)){
		var randomImage = '/images/banner' + (Math.round((Math.random()*numImages)+1)) + '.jpg';
		var imageHolder = getElement(imageHolderId);
		if(imageHolder.firstChild.setAttribute){		
			imageHolder.firstChild.setAttribute("src",randomImage);					
			window.setTimeout('fadeChangeImage(imageHolderIdTemp, numImagesTemp)',6000);
		}
	}
}

window.onload = function() {
    if (typeof slides != 'undefined') {
        if (document.images) {
            slides.image = document.images.slidesimg;
            slides.textid = "SLIDESTEXT";
            slides.update();
            slides.play();
        }
    }
}