
function HelpWindow() {
	var helpURL = "http://help.usajobs.gov/index.asp?url=http://www.usajobs.gov" + window.location.pathname;
	var winhelp = window.open(helpURL,"help","width=575,height=300,scrollbars,resizable");
	winhelp.focus();
}

function ShowJobSearchHelpSection(sectionName) {
    //new help file
    var helpURL = "http://jobsearch.usajobs.gov/help/Help.aspx?k=" + sectionName;
	var winhelp=window.open(helpURL,'help','width=740,height=600,scrollbars,resizable'); 
	winhelp.focus();
}

function ShowHelpSection(sectionName) {
    //old help file
    var helpURL = "http://help.usajobs.gov/" + sectionName;
	var winhelp=window.open(helpURL,'help','width=740,height=600,scrollbars,resizable'); 
	winhelp.focus();
}

function popHelpBookmark(strURLTarget) {
	var bSecureSite = false;

    if (popHelpBookmark.arguments.length > 1) bSecureSite = popHelpBookmark.arguments[1];
	var protocol = (bSecureSite) ? "https:" : "http:";

	var helpURL = protocol + "//www.usajobs.gov/help/index.asp?ma=" + window.location.pathname +'#' + strURLTarget;
	var winHelp = window.open(helpURL,"help","width=575,height=300,scrollbars,resizable");

	//if popup killed by a popupkiller ask the user to turn it off
    if(!winHelp){
		alertPopUpBlockerDetected();
    }
    winHelp.focus();
}

function newImage(arg) {
	if (document.images) {
		var rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		header_tab_search_over = newImage("http://media.newjobs.com/opm/www/usajobs/templates/search-OVER.gif");
		header_tab_myUSAJOBS_over = newImage("http://media.newjobs.com/opm/www/usajobs/templates/my-OVER.gif");
		header_tab_infocntr_over = newImage("http://media.newjobs.com/opm/www/usajobs/templates/info-OVER.gif");
		header_tab_vets_over = newImage("http://media.newjobs.com/opm/www/usajobs/templates/veterans-OVER.gif");
		header_tab_forms_over = newImage("http://media.newjobs.com/opm/www/usajobs/templates/forms-OVER.gif");
		header_tab_emplyr_over = newImage("http://media.newjobs.com/opm/www/usajobs/templates/emp-OVER.gif");
		resume_fld_error = newImage("http://media.newjobs.com/opm/cc/usajobs/resume/error.gif");
		header_help_over = newImage("http://media.newjobs.com/opm/www/usajobs/help_over.gif");
		preloadFlag = true;
	}
}

//Break out of frames
if (top.location != location) {
	top.location.href = document.location.href;
}

function popOPMHelp(strURLTarget)
{
	var winOPMHelp = window.open('https://my.usajobs.gov/help/index.asp?ma=/ResumeBuilderWizard.asp&qs=page=0#' + strURLTarget, "help", "width=650,height=315,scrollbars=1,resizable=yes");

	//if popup killed by a popupkiller ask the user to turn it off
    if(!winOPMHelp){
		alertPopUpBlockerDetected();
    }
    winOPMHelp.focus();
}

function popOPMLink(strURLTarget)
{
	var winOPMLink = window.open(strURLTarget, "help", "width=650,height=315,scrollbars=1,resizable=yes");

	//if popup killed by a popupkiller ask the user to turn it off
    if(!winOPMLink){
		alertPopUpBlockerDetected();
    }
    winOPMLink.focus();
}
function popOPMViewResume(strURLTarget)
{
	var winOPMLink = window.open(strURLTarget, "help", "width=750,height=800,scrollbars=1,resizable=yes");

	//if popup killed by a popupkiller ask the user to turn it off
    if(!winOPMLink){
		alertPopUpBlockerDetected();
    }
    winOPMLink.focus();
}
