// Hides all JS sliders before the dom is ready - instead of .hide() just add another selector in the css classes
$('html').addClass('js');

hideDevMenu = false;

$(document).ready(function() {
	// toggles the slickbox on clicking the noted link 
	$('.jobsearch_toggle').css('cursor','pointer').click(function() {
		$('.jobsearch_form').slideToggle('slow', function() {
			if ($('.jobsearch_form').is(':visible')) {
				$('.jobsearch_form input[type="text"]:first').focus();
			}
		});
		return false;
	});
	$('.jobsearch_form').hide();
	
	// Set the min height for the container via CSS
	var body_height = $(window).height();
	$('.container').css('min-height',body_height);
	
	// Carousel
	$('.home_content #client_logos').jcarousel({scroll:1});
	$('.cols_3 #client_logos').jcarousel({scroll:1,vertical:true});

	// jqModal
	$('#new_alert').addClass('jqmWindow').prepend('<a href="#" class="jqmClose">Close</a>').jqm({
		trigger: '.new_alert_button'
	});
	
	if(!hideDevMenu)
	{
	    //------------------------------------
	    // Dev Menu - Delete before going live
	    var links = [
		    { 'link':'Home'									, 'url' :'/_cutup/index.htm' },
		    { 'link':'About Ambition'						, 'url' :'/_cutup/about_ambition.htm' },
		    { 'link':'Contact Ambition'						, 'url' :'/_cutup/contact_ambition.htm' },
		    { 'link':'Sitemap'								, 'url' :'/_cutup/sitemap.htm' },
		    { 'link':'Privacy'								, 'url' :'/_cutup/privacy.htm' },
		    { 'link':'404'									, 'url' :'/_cutup/404.htm' },
		    { 'link':'Clients'								, 'url' :'/_cutup/clients.htm' },
		    { 'link':'Client Details'						, 'url' :'/_cutup/client_details.htm' },
		    { 'link':'Job Search'							, 'url' :'/_cutup/job_search.htm' },
		    { 'link':'Job Search Results'					, 'url' :'/_cutup/job_search_results.htm' },
		    { 'link':'Job Details'							, 'url' :'/_cutup/job_details.htm' },
		    { 'link':'Job Apply'							, 'url' :'/_cutup/job_apply.htm' },
		    { 'link':'Career Resources'						, 'url' :'/_cutup/career_resources.htm' },
		    { 'link':'Career Management'					, 'url' :'/_cutup/career_management.htm' },
		    { 'link':'Career Hurdles'						, 'url' :'/_cutup/career_hurdles.htm' },
		    { 'link':'Events (Current)'						, 'url' :'/_cutup/events_current.htm' },
		    { 'link':'Events (Past)'						, 'url' :'/_cutup/events_past.htm' },
		    { 'link':'Standard Content Page'				, 'url' :'/_cutup/standard_content_page.htm' },
		    { 'link':'Contact Ambition'						, 'url' :'/_cutup/contact_ambition.htm' },
		    { 'link':'Login'								, 'url' :'/_cutup/login.htm' },
		    { 'link':'Register'								, 'url' :'/_cutup/register.htm' },
		    { 'link':'My Details'							, 'url' :'/_cutup/my_details.htm' },
		    { 'link':'Jobs Applied For'						, 'url' :'/_cutup/my_jobs_applied_for.htm' },
		    { 'link':'My Alerts'							, 'url' :'/_cutup/my_alerts.htm' }
    		
	    ];
	    $('<ul />').attr({'id':'devMenu', 'style':'width: 200px; padding: 10px; position: absolute; top: 10px; left: 10px; background: #fff;'}).hover(function(){$(this).stop().animate({opacity:'1'}, 200);},function(){$(this).stop().animate({opacity:'0.3'}, 200);}).prependTo('body');
	    $('#devMenu').animate({opacity: '0.3'}, 200);
	    //for (var i in links) { $('<li><a href="' + links[i].url + '">' + links[i].link + '</a>').appendTo('#devMenu'); }
	    $.each(links, function() { $('<li><a href="' + this.url + '">' + this.link + '</a>').appendTo('#devMenu'); });
	    // End of Dev Menu
	    //------------------------------------
	}
});