///////////////////////////////////////////////
/*  Jobs global scripts                      */
///////////////////////////////////////////////


/* begin image rollovers */

function roll_over(img_name, img_src)
	{
		document[img_name].src = img_src;
	}

/* end image rollovers */


/*  begin quick search boxes - default text  */

function onFocusSearchBox(field, defaultText) {
    if (field.value == defaultText) {
        field.value = "";
    }
    if (field.className.indexOf("main_search_box_black") == -1) {
    	field.className = field.className+" main_search_box_black";
    }
    if (field.className.indexOf("main_search_box_gray") >= 0) {
    	field.className = field.className.replace("main_search_box_gray","");
    }
}

function onBlurSearchBox(field, defaultText) {
    var trimmed = field.value.replace(/^\s+|\s+$/g, "");
    if (trimmed == "") {
        //field.value = defaultText;
    }
    if (trimmed == defaultText) {
	    if (field.className.indexOf("main_search_box_grey") == -1) {
	    	field.className = field.className+" main_search_box_grey";
	    }
	    if (field.className.indexOf("main_search_box_black") >= 0) {
	    	field.className = field.className.replace("main_search_box_black","");
	    }
  	}

}

function submitSearchBox(field, defaultText)
{
	if (field.value == defaultText || field.value == "")
	{
		field.value = "";
	}
	field.form.submit();
}


function changeText(a) {

text_id = document.getElementById(a);

text_id.style.color = "#000000";

}

/*  end quick search boxes - default text  */


/*  begin get count of selected items in a multi-select list  */

/*  JS_ResumeProfileDesires.jsp - Desired Location  */
function getDLSelCount(thisSel)
{
	var selCount = 0;
	
	for (var i=0; i<thisSel.length; i++)
	{
		if (thisSel[i].selected)
		{
			selCount += 1;
		}
	}
	
	document.getElementById("DLSelCount").innerHTML = selCount
}

/*  JS_ResumeProfileDesires.jsp - Featured Employers  */
function getFESelCount(thisSel)
{
	var selCount = 0;
	
	for (var i=0; i<thisSel.length; i++)
	{
		if (thisSel[i].selected)
		{
			selCount += 1;
		}
	}
	
	document.getElementById("FESelCount").innerHTML = selCount
}

/*  end get count of selected items in a multi-select list  */


// This function opens all external hyperlinks in a small popup window
function openEmpLink(p_url,p_close) {
	winPropsLarge = "height=563,width=740,top=60,left=80,screenX=80,screenY=60,resizable,scrollbars";
    if (p_url != null && p_url !="")
    {
       t2_win = window.open(''+p_url+'', 'EmployerSite', winPropsLarge);
       t2_win.window.focus();
    }
}