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

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

// --- namespace variables -------

// --- page functions -------

pctsFramework.transitionSecureIcons = function() {
	// match the classes that are secure, and make them free
	$(".pdfSecure").addClass("pdfFree");
	$(".pdfSecure").removeClass("pdfSecure");
	
}

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


// --- 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", resources.setIcons);

} else {
	// attached events for other browsers
	window.addEventListener('load', resources.setIcons, false);

}