/*
 LAUNCHER - Clubsational Window Launchers
 (c) Timothy Anido 2006/2007
 
Launches popup windows

*/

basepath = '/';

var left, top;
var width, height;

function CalculateCoords ( )
{
	left   = (screen.width  - width) / 2;
	top    = (screen.height - height) / 2 - 100;
}

var mparams = ', directories=no';
mparams += ', location=no';
mparams += ', menubar=no';
mparams += ', resizable=no';
mparams += ', scrollbars=no';
mparams += ', status=no';
mparams += ', toolbar=no';

function launchVoucherWindow( id )
{
	width  = 435;
	height = 405;
	CalculateCoords( );
	
	var url = basepath + "voucher/print/" + id + "/1";
	var params = 'width='+width+', height='+height + ', top='+top+', left='+left + mparams;
	voucher = window.open( url, "voucher", params );
}

function launchStaysVoucherWindow( id )
{
	width  = 435;
	height = 405;
	CalculateCoords( );
	
	var url = basepath + "voucher/print/" + id + "/2";
	var params = 'width='+width+', height='+height + ', top='+top+', left='+left + mparams;
	voucher = window.open( url, "voucher", params );
}

function launchMapWindow( address )
{
	width  = 620;
	height = 470;
	CalculateCoords( );
	
	var url = "http://www.clubsational.com.au/gmap.php?id=" + address;
	var params = 'width='+width+', height='+height + ', top='+top+', left='+left + mparams;
	map = window.open( url, "map", params );
}

function launchNoticeWindow( )
{
	width  = 500;
	height = 320;
	CalculateCoords( );
	
	var url = basepath + "notice.php";
	var params = 'width='+width+', height='+height + ', top='+top+', left='+left + mparams;
	notice = window.open( url, "notice", params );
}

function launchJobWindow( id )
{
	width  = 500;
	height = 400;
	CalculateCoords( );
	
	var url = basepath + "printjob.php?id=" + id;
	var params = 'width='+width+', height='+height + ', top='+top+', left='+left + mparams + ', scrollbars=yes';
	job = window.open( url, "job", params );
}

function launchShareWindow( id )
{
	width  = 565;
	height = 500;
	CalculateCoords( );
	
	var url = basepath + "club/share/" + id;
	var params = 'width='+width+', height='+height + ', top='+top+', left='+left + params;
	notice = window.open( url, "notice", params );
}

function launchStayShareWindow( id )
{
	width  = 565;
	height = 500;
	CalculateCoords( );
	
	var url = basepath + "share_stay.php?id=" + id;
	var params = 'width='+width+', height='+height + ', top='+top+', left='+left + params;
	notice = window.open( url, "notice", params );
}

function launchBookingWindow( id )
{
	width  = 565;
	height = 550;
	CalculateCoords( );
	
	var url = basepath + "book.php?id=" + id;
	var params = 'width='+width+', height='+height + ', top='+top+', left='+left + params;
	notice = window.open( url, "book", params );
}

function launchJobShareWindow( id )
{
	width  = 565;
	height = 500;
	CalculateCoords( );
	
	var url = basepath + "jobs/share/" + id;
	var params = 'width='+width+', height='+height + ', top='+top+', left='+left + params;
	notice = window.open( url, "notice", params );
}