/*
	Title: Common JavaScript [Version 3]
	Description: Common javascript functions for all websites
	Author: James Hartcher
	Created: 22/07/2003
	Modified: 11/12/2006
	
	Copyright © 2005/6 Internet Design Studios Pty Ltd, All Rights Reserved
	www.idstudios.com.au
*/

// Image Change
function image_change(obj,image) {
	objElement = find_object(obj);
	objElement.src = image;
}

// Class Change
function class_change(obj,class_name) {
	objElement = find_object(obj);
	objElement.classname = class_name;
}

// Change Z-Index
function zindex_change(obj,index) {
	objElement = find_object(obj);
	objElement.style.zIndex = index;
}

// Find object
function find_object(obj) {
	var ie=document.all;
	var ns6=document.getElementById && !document.all;
	if (ie||ns6) {
		var objElement = document.all? document.all[obj] : document.getElementById? document.getElementById(obj) : "";
	}
	return objElement;
} 

// Popup Window
function popup_window(window_url, window_name, window_width, window_height) {
	new_window = window.open(window_url,window_name,"width="+window_width+",height="+window_height+",resizable=no,status=no,scrollbars=no,location=no,menubar=no,toolbar=no");
	if (window.focus) {
		new_window.focus();
	}
	return false;
}

// Page Jump (Select Box Navigation)
function page_jump(obj,page_prefix) {
	select_options = obj; //find_object(obj);
	page_suffix = select_options.options[select_options.selectedIndex].value;
	if (page_suffix) {
		destination = page_prefix + page_suffix;
		location.href = destination;
	}
}

// Go Blank (Used to replace Default Fields)
function go_blank(obj,default_value) {
	input_field = obj; //find_object(obj);
	current_value = input_field.value;
	if (current_value == default_value) {
		input_field.value = "";
		input_field.style.backgroundImage = "none";
	}		
}

// Print Page
function print_page() {
	window.print();  
}

// Insert Flash
function InsertFlash(html)
{
	document.write(html);
}

// Menu rollovers
function rollover(sender, image) {
  // Change image
 sender.getElementsByTagName('img')[0].src = image;
  
}

function rolloff(sender, image) {
  // Change image
 sender.getElementsByTagName('img')[0].src = image;
  
}


// Toggle Login
function ShowLogin() {

	// Find Objects
    var objLogin 		= find_object('signin');
	var objLoginEmail 	= find_object('login_email');

	var objButtons 	= find_object('header_login');
	var objTicker 	= find_object('header_ticker');
	
	// Toggle Display
    if (objLogin.style.display == "none" || !objLogin.style.display) {
        objLogin.style.display = "block";
        objButtons.style.display = "none";
        objTicker.style.display = "none";

      	objLoginEmail.focus();
    } else if (objLogin.style.display == "block") {
        objLogin.style.display = "none";
        objButtons.style.display = "block";
        objTicker.style.display = "block";
    }

	// Return False
    return false;
}

