﻿/// <reference path="x:\includes\temp\TestModeFile.js" />
/// <reference path="/assets/javascripts/layoutObject.js" />


/** { [lowenCertified.LayoutObject]
* @purpose :: 
* @param :: 
* @return :: 
* @creation :: 
* @dependency :: [lib.functions.window.Catch]
* @dependency :: [lib.functions.window.AddListener]
* @dependency :: [lib.functions.dom.getElem]
* @dependency :: [lib.functions.window.maskEmail]
* /---/ 
* @author :: Scott McDonald;
* @license :: Lowen Corporation Use Only [Proprietary Script]
* /---/ 
*/
function LayoutObject() {
	var target = this;
	try {
		this.typename = "lowenCertified.LayoutObject";
		this.pageObject = undefined;
		this.openMenu = function(menuName) {
			try {
				var o = getElem(menuName);
				if (o) {
					trace(o.id);
				};
			} catch (e) { Catch(this.typename + ".openMenu", e, true); };
		};

		this.registerOnload = function() {
		};
		this.onPageLoad = function() {
			if (this.pageObject) {
				if (this.pageObject.onPageLoad) {
					this.pageObject.onPageLoad();
				};
			} else {
				this.pageObject = new PageObject();
				if (this.pageObject.onPageLoad) {
					this.pageObject.onPageLoad();
				};
			};
		};


		this.showWhatsThis = function(ccType) {
			try {
				var ajax = new Ajax();
				ajax.method = "POST";
				ajax.add("closebutton", "window.lock.close();");
				ajax.add("whatcard", ccType);
				ajax.url = "/inc/ajaxMethods/_method.WhatIsCCV.asp";
				ajax.onSuccess = function(x, t) {
					try {
						window.lock.show(t, -1);
					} catch (e) { Catch(this.typename + ".showWhatsThis.onSuccess", e, true); };
				};
				ajax.send();
			} catch (e) { Catch(this.typename + ".showWhatsThis", e, true); };
		};
		
		this.constructor = function() {
			try {
				if (AddListener) {
					AddListener(window, "load", function() {
						target.onPageLoad();
					});
				} else {
					alert("something went wrong!");
				};
			} catch (e) { Catch(this.typename + ".constructor", e, true); };
		};
		this.openImageWindow = function(url) {
			var image = new Image();
			image.onload = function() {
				if (window.imgWindow) {
					if (!window.imgWindow.closed) {
						window.imgWindow.close();
					}
					window.imgWindow = undefined;
				};
				window.imgWindow = window.open("", "WrapoffImages", "width=" + (this.width + 5) + ",height=" + (this.height + 60));
				var html = "<html>";
				html += "<title>Wrapoff Images</title>";
				html += "<style>";
				html += "body {margin:0px;padding:0px;background-color:#000000;color:#FFFFFF;}";
				html += "a {color:#ffffff;}";
				html += "</style>";
				html += "<body>"
				html += "<center><img  alt=\"\" src=\"" + url + "\" border=\"0\" /></center>";
				html += "<br />";
				html += "<div style=\"text-align:center;font-family:arial, helvetica;margin-top:5px;\"><a href=\"" + url.toLowerCase().replace("/pressrelease/images/", "/pressrelease/images/originals/") + "\" target=\"_blank\">View Original Image</a>";
				html += "<br />";
				html += "<a href=\"javascript:;\" onclick=\"window.close();\">Close Window</a></div>";
				html += "</body></html>";
				window.imgWindow.document.write(html);
			};
			image.src = url + "?" + getPepper();
		};
		this.constructor();
	} catch (e) { Catch(this.typename + ".base", e, true); };
};
/** } [lowenCertified.LayoutObject] **/


/** load the page object **/
window.layoutObject = new LayoutObject();
/** **/