
// initialize Shadowbox
Shadowbox.init({
	animateFade: false,
	animate: false,
	resizeDuration: 0.5,
	displayNav: false,
	useSizzle: false,
	initialWidth: 700,
	initialHeight: 1,
    skipSetup: true,
	players: ["html","iframe"]
});


// setup DOM loaded actions
document.observe("dom:loaded", function() {
	// HORIZONTAL RULES
	// nest the <hr> element into a div container for customization via CSS
	// unless it has already been nested in a div with "HorzRule" class name
	var allHorzRules = $$("hr");
	allHorzRules.each(function (hr) {
		var parentNode = hr.up();
		if (!(parentNode.tagName.toLowerCase() == "div" && parentNode.hasClassName("HorzRule"))) {
			$(hr).wrap("div", { "class": "HorzRule" });
		}
	});
	
	// setup "Job Seeker Login" link to use Shadowbox - Menu Link
	if ($("JobSeekerMenuLogin")) {
		$("JobSeekerMenuLogin").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/jobseeker/login.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Job Seeker Login" link to use Shadowbox
	if ($("JobSeekerLogin")) {
		$("JobSeekerLogin").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/jobseeker/login.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}
	
	// setup "Employer Login" link to use Shadowbox - Menu Link
	if ($("EmployerMenuLogin")) {
		$("EmployerMenuLogin").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/employer/login.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Employer Login" link to use Shadowbox
	if ($("EmployerLogin")) {
		$("EmployerLogin").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/employer/login.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Forgot Password" for employers link to use Shadowbox
	if ($("ForgotPasswordEmployer")) {
		$("ForgotPasswordEmployer").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/employer/forgotpassword.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Forgot Password" for job seekers link to use Shadowbox
	if ($("ForgotPasswordJobSeeker")) {
		$("ForgotPasswordJobSeeker").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/jobseeker/forgotpassword.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	/////////////////////////////////////////////////////////////////
	// HELP
	/////////////////////////////////////////////////////////////////

	// setup "Contact Maint Contact Name" help link to use Shadowbox
	if ($("ContactName")) {
		$("ContactName").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/help/ContactName.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Contact Email" help link to use Shadowbox
	if ($("ContactEmail")) {
		$("ContactEmail").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/help/ContactEmail.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Contact Email" help link to use Shadowbox
	if ($("DisplayEmail")) {
		$("DisplayEmail").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/help/DisplayEmail.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Logo" help link to use Shadowbox
	if ($("Logo")) {
		$("Logo").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/help/Logo.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Display HTML" help link to use Shadowbox
	if ($("DisplayHTML")) {
		$("DisplayHTML").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/help/DisplayHTML.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Poster Job Title" help link to use Shadowbox
	if ($("JobTitle")) {
		$("JobTitle").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/help/JobTitle.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Candidate Requirements" help link to use Shadowbox
	if ($("CandidateRequirements")) {
		$("CandidateRequirements").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/help/CandidateRequirements.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Job Description" help link to use Shadowbox
	if ($("JobDescription")) {
		$("JobDescription").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/help/JobDescription.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Keywords" help link to use Shadowbox
	if ($("Keywords")) {
		$("Keywords").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/help/Keywords.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}

	// setup "Instructions" help link to use Shadowbox
	if ($("Instructions")) {
		$("Instructions").observe("click", function(evt) {
			evt.stop();
			Shadowbox.open({
				content: "/help/Instructions.html",
				player: "iframe",
				title: this.title,
				width: 400,
				height: 300,
				options: {
					initialWidth: 400
				}
			});
		});
	}


});