﻿Event.observe(window, 'load', function() {if (window.initSeal) window.initSeal();});

function initSeal() {
	// To turn on site certificate logo until after the page is loaded so it does not delay 
	// the page rendering by going to the Verisign website
	if($('siteSeal')) {
		$('siteSeal').setStyle({visibility: 'visible'});
	}
}

/*------------------- Window stuff -------------------------*/
//var newWin = null;
//var winIndex = 0;
function openWindowMessages(targetTitle, targetUrl, height, width) {
	var wu = DDM.WindowUtilities;
	var clientHeight = parseInt(wu.getPageSize().windowHeight, 10);
	var clientWidth = parseInt(wu.getPageSize().windowWidth, 10);
	var targetHeight = height;
	var targetWidth = width;
	var targetLeft = 25;
	var windowHeight = clientHeight - parseInt(wu.getPageScroll(),10);

	//if (targetWidth < clientWidth) targetLeft = (clientWidth - targetWidth) / 2;
	//var targetTop = Math.max(130, parseInt(wu.getPageScroll(),10) + 40);
	var targetTop = 25;
	
	CSS.preloadImages();

	var w = new UI.URLWindow({
			theme: 'applianceGuy',
			shawdowTheme: 'drop_shadow',
			top: targetTop,
			left: targetLeft,
			shadow: true,
			width: targetWidth, 
			height: targetHeight,
			url: targetUrl
		}
	);
	w.setHeader(targetTitle).setDraggable(false).setResizable(false).removeButton('maximize').removeButton('minimize').show(true).focus();
	//winIndex ++;
}

function openPrivacyWindow() {
	openWindowMessages("Privacy Statement", "../../Privacy.htm", 450, 420)
}

function openCopyrightWindow() {
	openWindowMessages("Copyright Notice", "Copyright.htm", 400, 420)
}

function openSiteAgreementWindow() {
	openWindowMessages("Copyright / Web Site User Agreement", "SiteAgreement.aspx", 450, 550)
}
