/**
 * This has sort of become the "default" javascript file because there is a navpanel on virtually
 * every page. If you need functionality that is here on a page without a navpanel, just include
 * it anyway.
 *
 * @@@ Not actually true anymore; c.js loads on all candidate pages and r.js loads for all network
 * 	   pages now.
 */
function getSavedJobsCount(candidate,site,destination) {
	new Ajax.Request('/c2/includes/getsavedjobs.cfm?candidate_id=' + candidate + '&site_id=' + site + '&count=1',
	{
		method: 'get',
		onSuccess: function(transport) {
			var response = transport.responseText || '';
			if(response != '') {
				$(destination).innerHTML = response;
			} else {
				$(destination).innerHTML = 'Jobs Retrieval Failed.';
			}
		},
		onFailure: function() {
		}
	});
}

function greenArrowToggle(link,target) {
	$(link).blur();

	var upArrow = new Image();
	upArrow.src = '/images/new/greenarrow_up.gif';
	upArrow.alt = 'Hide';
	var downArrow = new Image();
	downArrow.src = '/images/new/greenarrow_down.gif';
	downArrow.alt = 'Show';

	if($(target).style.display == 'none') {
		new Effect.BlindDown(target, { duration: 0.2 } );
		new Effect.Invoke( { invoke: function() { fixRightHeight() } }, { queue: 'end' } );
		var theImage	= $(link).getElementsByTagName('img')[0];
		theImage.src	= upArrow.src;
		theImage.alt	= "Hide";
		theImage.title	= "Hide";
	} else {
		new Effect.BlindUp(target, { duration: 0.2 } );
		new Effect.Invoke( { invoke: function() { fixRightHeight() } }, { queue: 'end' } );
		var theImage	= $(link).getElementsByTagName('img')[0];
		theImage.src	= downArrow.src;
		theImage.alt	= "Show";
		theImage.title	= "Show";
	}
}
