$(document).ready(function() {
	
	
	// Add print header to top of page
		    //$("body").prepend("<h5 class=\"print\">Cornerstone Technologies</h5>");
		$("body").prepend("<h5 class=\"print\">Davies Park | Executive Search Consultants</h5>");

  // make dropdown fancy
	$("ul#nav_1155263").supersubs({ 
             minWidth:    12,   // minimum width of sub-menus in em units 
             maxWidth:    27,   // maximum width of sub-menus in em units 
             extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                                // due to slight rounding differences and font-family 
         }).superfish();  // call supersubs first, then superfish, so that subs are 
                          // not display:none when measuring. Call before initialising 
                          // containing tabs for same reason.
	
	
	
	$('ul.#nav_1155263 li a:first').addClass('first');
	
	/*	if($("#flash").length >0){	
			$('#flash').flash({
			    src: 'banner.swf',
			    width: 683,
			    height: 297
			});
			}*/
			
			

			
	
	
	//email spam protection
	$('.email').each(function() {
		var $email = $(this);
		var address = $email.text()
		.replace(/\s*\[at\]\s*/, '@')
		.replace(/\s*\[dot\]\s*/g, '.');
		$email.html('<a href="mailto:' + address + '">'+ address +'</a>');
	});
	
	
	// Open job application form																		
		$('#app-calgary, #app-edmonton, #app-vancouver').hide();
		$('.resume.Calgary a').click(function(){
			$('#app-calgary').toggle('medium');
		});
		$('.resume.Edmonton a').click(function(){
			$('#app-edmonton').toggle('medium');
		});

		$('.resume.Vancouver a').click(function(){
			$('#app-vancouver').toggle('medium');
		});

	// Remove Border From Fist List Item
		$('#nav li:first, .sub li:first, .sub-sub li:first').addClass('no-border');
		
		// Remove Border and padding From Item
		$('table.team td:first, table.team tr:first').addClass('first');

		$(".webappsearchresults .job-board:first").before("<table width=\"773\" class=\"job-board-top\"><tbody><tr><td width=\"74\" align=\"left\" valign=\"top\">&nbsp;</td><td width=\"81\" align=\"left\" valign=\"top\">CAREER #</td><td width=\"606\" align=\"left\" valign=\"top\">TITLE</td></tr></tbody></table>");

		// Make entire table clickable
		if($("table.job-board a").length >0){
			$("table.job-board a").bigTarget({
			    hoverClass: 'over', // CSS class applied to the click zone onHover
			    clickZone : 'table:eq(0)' // jQuery parent selector
		});}

	// Show total number of jobs in <div id="total-number">n</div>	
		totalnum=$(".job-board td:last").html();	
		if(totalnum > 0) {
			$("#total-number").html(totalnum).append(" career opportunities displayed");
		} 
		else {
			$("#total-number").hide();
		}


});




















