/*
	
	EMERSON COLLEGE
		Javascript
		Essay functions
	
*/

function displayHelpDetail(previewID,displayID) {
	
	// Hide details
	if (Element.visible( displayID ) === false) {
		
		new Effect.BlindDown(displayID,
			{
				duration:0.6,
				beforeStart:
					function(x) {
						if (Element.visible(previewID) === true) {
							new Effect.BlindUp(previewID, { duration:0.5 });
						}
					}
			});
		
	} else {
		
		new Effect.BlindUp(displayID,
			{
				duration:0.6,
				beforeStart:
					function(x) {
						if (Element.visible(previewID) === false) {
							new Effect.BlindDown(previewID, { duration:0.5 });
						}
					}
			});
		
	}
}

function essay_previewAlert() {
	
	if ($("essay_help_preview") != undefined) {
		new Effect.Pulsate("essay_help_preview", {duration: 03, from: 0.3})
	}
	
}

function resume_previewAlert() {
	
	if ($("resume_help_preview") != undefined) {
		new Effect.Pulsate("resume_help_preview", {duration: 03, from: 0.3})
	}
	
}

function essay_saveEssay() {
	
	// Run TinyMCE Save Function
		tinyMCE.triggerSave();
		
	// Submit form itself
		$('paappsEssaySubmission_form').submit();
		
}

function resume_saveResume() {
	
	// Run TinyMCE Save Function
		tinyMCE.triggerSave();
		
	// Submit form itself
		$('paappsResumeSubmission_form').submit();
		
}

function essay_SubmitConfirm() {
	
	var essay_otherInterface = "essay_preview";
	var essay_confirmationDiv = "essay_confirmation";
	
	// Hide all other interface
		if (Element.visible(essay_otherInterface) === true) {
			new Effect.BlindUp(essay_otherInterface);
		}
		
	// Show conformation box
		if (Element.visible(essay_confirmationDiv) === false) {
			new Effect.BlindDown(essay_confirmationDiv);
		}
		
	// IE Window fix
		scrollWindowFix('emerson_body_fix');
		
}

function resume_SubmitConfirm() {
	
	var resume_otherInterface = "resume_preview";
	var resume_confirmationDiv = "resume_confirmation";
	
	// Hide all other interface
		if (Element.visible(resume_otherInterface) === true) {
			new Effect.BlindUp(resume_otherInterface);
		}
		
	// Show conformation box
		if (Element.visible(resume_confirmationDiv) === false) {
			new Effect.BlindDown(resume_confirmationDiv);
		}
		
	// IE Window fix
		scrollWindowFix('emerson_body_fix');
		
}

function essay_submitFullConfirm() {
	
	// Hit the send on the form.
		$('paappsEssaySubmission_form').submit();
		
}

function resume_submitFullConfirm() {
	
	// Hit the send on the form.
		$('paappsResumeSubmission_form').submit();
		
}

