// JavaScript page methods for pctsWeb
// PAGE = ameliored.php

// declare a page namespace
var edtracker = {};

// --- namespace variables -------
edtracker.galleryTop = 102;
edtracker.galleryLeft = '';
edtracker.slideCollection = new Array();

// --- page functions -------
pctsFramework.transitionSecureIcons = function() {
	// match the classes that are secure, and make them free
	$(".requestEDTrackerBrochureInactive").addClass("requestEDTrackerBrochure");
	$(".requestEDTrackerBrochureInactive").removeClass("requestEDTrackerBrochureInactive");
	
}

edtracker.setSlideLeft = function() {
	// set the left position of slides on this page for an image gallery 
	
	// first, get the top and left of the imageGallery object
	// aed.galleryTop = pctsFramework.GetElementTop(document.getElementById('imageGallery'));
	aed.galleryLeft = pctsFramework.GetElementLeft(document.getElementById('imageGallery'));
	
	// now iterate through the slide collection to position the slides
	document.getElementById('slide001').style.top = aed.galleryTop + 'px';
	document.getElementById('slide001').style.left = aed.galleryLeft + 20 + 'px';
	
	// now iterate through the slide collection to position the slides
	document.getElementById('slide002').style.top = aed.galleryTop + 111 + 'px';
	document.getElementById('slide002').style.left = aed.galleryLeft + 20 + 'px';
	
	// now iterate through the slide collection to position the slides
	document.getElementById('slide003').style.top = aed.galleryTop + 222 + 'px';
	document.getElementById('slide003').style.left = aed.galleryLeft + 20 + 'px';
}

edtracker.setIcons = function() {
	// on load, see if the pctsFramework secure mode is set, and if so, transition icons as appropriate.
	
	if(pctsFramework.resourceSecure != true) {
		// a secure mode is in place, meaning the user already registered during this session
		$(".requestEDTrackerBrochure").addClass("requestEDTrackerBrochureInactive");
		$(".requestEDTrackerBrochure").removeClass("requestEDTrackerBrochure");
		
	}
}

// --- attached events -------

// we attach inside an if statement because IE handles event listeners differently from other browsers.

if (window.attachEvent) {
	// attached events for IE
	window.attachEvent("onload", edtracker.setIcons);
	
} else {
	// attached events for other browsers
	window.addEventListener('load', edtracker.setIcons, false);

}