﻿/**
*   Include : Library
*
*   Include stores all non-object related library functions
*
*   @usage    Used by all pages to provide access to useful document / window related methods
*   @author   Daniel Ivanovic dan@substance001.com
*/

/**
*	GoToWindow
*	
*	Opens a new window
*
*	@param	w - window destination
*/
function GoToWindow(w)
{
	window.location = w;
}

/**
*	Popup
*	
*	Opens a new popup window
*
*	@param	w - window destination
*	@param	id - window id
*/
function Popup(w, id, wth, hgt)
{
	// center the window
	var left = ( screen.width - wth ) / 2;
	var top = ( screen.height - hgt ) / 2;
	
	// create the window params
	var params = 'width='+wth+', height='+hgt;
	params += ', top='+top+', left='+left;
	params += ', directories=no';
	params += ', location=no';
	params += ', menubar=no';
	params += ', resizable=no';
	params += ', scrollbars=no';
	params += ', status=no';
	params += ', toolbar=no';
	
	// open the window
	var newwin = window.open( w, id, params );
	if (window.focus) {newwin.focus()}
	return false;
}

/**
*   getMovie
*
*   Locates and returns a movie within the page
*
*	@param	movieName - the name of the movie to return
*/
function getMovie(movieName) 
{
	return document.getElementById( movieName );
}

/**
*	DD_belatedPNG : Default function
*
*	Replaces the DD_belatedPNG object to stop all browsers throwing a fit if DD_belatedPNG script is not included
*/
var DD_belatedPNG = {
	fix: function(selector) { return false; }
};