//=======================================================================================================
//-------------------------------------------------------------------------------------------------------
//	Custom Javascript functions
//-------------------------------------------------------------------------------------------------------
//=======================================================================================================
//
var step = 0;

function rotateSlideshow()
{
	var count = step % img_array.length;

	current_image = img_array[count][0];
	current_quote = img_array[count][1];
	current_image_alt = img_array[count][2];
	current_quote_alt = img_array[count][3];

	document.getElementById('slideshow_image').src = current_image;
	document.getElementById('slideshow_quote').src = current_quote;
	document.getElementById('slideshow_image').alt = current_image_alt;
	document.getElementById('slideshow_quote').alt = current_quote_alt;

	step++;

	setTimeout("rotateSlideshow()", 10000);
}

function addToOnload( new_func )
{
    var curr_onload = window.onload;

    if(typeof curr_onload == 'function') {
        window.onload = function(){
            curr_onload();
            new_func();
        };
    } else {
        window.onload = new_func;
    }
}

//-------------------------------------------------------------------------------------------------------
//	Clear the default value from a form field when selected
//-------------------------------------------------------------------------------------------------------
function ResetField( fieldobj, defaulttext )
{
	if( fieldobj.value == defaulttext )
	{
		fieldobj.value	= '';
	}
}