﻿var BluePrint = new Object ();

BluePrint.ImageDataSource = new Object ();
BluePrint.ImageDataSource.Images = new Array ();

BluePrint.WindowManager = new Object ();
BluePrint.WindowManager.Launch = function (url, name, width, height, scrollable)
{
	topCentered = Math.round ((screen.availHeight - height) / 2);
	leftCentered = Math.round ((screen.availWidth - width) / 2);
	
	openedWindow = window.open (url, name, "width=" + width + ",height=" + height + ",top=" + topCentered + ",left=" + leftCentered + ",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=" + scrollable + ",resizable=0");
	openedWindow.focus ();
	
	return openedWindow;
}

BluePrint.ImageDataSource.RegisterImage = function (name, source)
{
        if (name == null || name == "")
                throw "You must specify an image name.";
                
        if (source == null || source == "")
                throw "You must specify an image source.";
        
        this.Images [name] = new Image ();
        this.Images [name].src = source;
}

BluePrint.ImageDataSource.ChangeImageSource = function (imageObject, destName)
{
        if (imageObject == null || imageObject == "")
                throw "You must specify an image object.";
                
        if (destName == null || destName == "")
                throw "You must specify a destination image source.";
                
        imageObject.src = this.Images [destName].src;
}

BluePrint.WriteIETag = function (url, width, height)
{
    document.write("<object type=\"application/x-shockwave-flash\" data=\"" + url + "\" width=\"" + width + "\" height=\"" + height + "\">");
    document.write("<param name=\"movie\" value=\"" + url + "\" />");
    document.write("<param name=\"quality\" value=\"high\" />");
    document.write("<param name=\"menu\" value=\"false\" />");
    document.write("<param name=\"scale\" value=\"noscale\" />");
    document.write("<param name=\"bgcolor\" value=\"#666\" />");
    document.write("</object>");
}