jQuery(document).ready(function() 
{
	jQuery('a').each(function(){
		if(jQuery(this).attr('href').substr(jQuery(this).attr('href').length-4,4)==".pdf")
		{
			if (this.className != "noform")
				jQuery(this).facebox().attr('href', "/forms/downloadpdf/DownloadPdf.ashx?pdfurl="+this.href);
		}
	});

	jQuery("h5").click(function() {
		this.className == "toggled" ? jQuery(this).removeClass() : jQuery(this).addClass("toggled"); // Change header class over
    	jQuery(this).next().toggle();		// Show our blockquote section
	});
	if (jQuery("#listofalljobs")[0])
	{
		jQuery.get(base+"/job/list.ashx?canselectregion=true&cancellayout=true&uniqueid="+Math.floor(Math.random()*10000000), function(data) {
			jQuery("#listofalljobs").html(data);
		});
	}		
	if (jQuery("#listofsouthjobs")[0])
	{
		jQuery.get(base+"/job/list.ashx?hideresults=true&region=south&cancellayout=true&uniqueid="+Math.floor(Math.random()*10000000), function(data) {
			jQuery("#listofsouthjobs").html(data);
		});
	}
	if (jQuery("#listofmidlandsjobs")[0])
	{
		jQuery.get(base+"/job/list.ashx?hideresults=true&region=midlands&cancellayout=true&uniqueid="+Math.floor(Math.random()*10000000), function(data) {
			jQuery("#listofmidlandsjobs").html(data);
		});
	}
	if (jQuery("#listofnorthjobs")[0])
	{
		jQuery.get(base+"/job/list.ashx?hideresults=true&region=north&cancellayout=true&uniqueid="+Math.floor(Math.random()*10000000), function(data) {
			jQuery("#listofnorthjobs").html(data);
		});
	}
	if (jQuery("#listofnortheastjobs")[0])
	{
		jQuery.get(base+"/job/list.ashx?hideresults=true&region=north%20east&cancellayout=true&uniqueid="+Math.floor(Math.random()*10000000), function(data) {
			jQuery("#listofnortheastjobs").html(data);
		});
	}
	if (jQuery("#listofscotlandjobs")[0])
	{
		jQuery.get(base+"/job/list.ashx?hideresults=true&region=scotland&cancellayout=true&uniqueid="+Math.floor(Math.random()*10000000), function(data) {
			jQuery("#listofscotlandjobs").html(data);
		});
	}
	if (jQuery("#listoflondonjobs")[0])
	{
		jQuery.get(base+"/job/list.ashx?hideresults=true&region=london&cancellayout=true&uniqueid="+Math.floor(Math.random()*10000000), function(data) {
			jQuery("#listoflondonjobs").html(data);
		});
	}
	if (jQuery("#listofallevents")[0])
	{
		jQuery.get(base+"/event/list.ashx?hideresults=true&cancellayout=true", function(data) {
			jQuery("#listofallevents").html(data);
		});
	}
	if (jQuery("#requestquoteform")[0])
	{
		jQuery.get(base+"/quote/requestquote.ashx?cancellayout=true&uniqueid="+Math.floor(Math.random()*10000), function(data) {
			jQuery("#requestquoteform").html(data);
		});
	}
	if (jQuery("#careermarquee")[0])
	{
		jQuery.get(base+"/job/GetJobsMarquee.ashx", function(data) {
			jQuery("#careermarquee").html(data);
			jQuery('marquee').marquee('careermarquee').mouseover(function () { $(this).trigger('stop'); }).mouseout(function () { $(this).trigger('start'); });
		});
	}
 });
