//new preload imgs
//$(document).ready(function(){
//  $.preloadCssImages();
//});

//new display function
$(document).ready(function(){
	
	$(".toggle_container").hide();

	$("h2.trigger").toggle(function(){
		$(this).addClass("active"); 
		}, function () {
		$(this).removeClass("active");
	});
	
	$("h2.trigger").click(function(){
		$(this).next(".toggle_container").slideToggle("slow,");
	});

});


//make HTML5 placeholders work in non supportive browsers
$(document).ready(function() {
  $("input[placeholder]").each(function(){
    if($(this).val()==""){
     // $(this).addClass('hasplaceholder');
      $(this).val($(this).attr("placeholder"));
      $(this).focus(function(){
        if($(this).val()==$(this).attr("placeholder")) $(this).val("");
       // $(this).removeClass('hasplaceholder');
      });
      $(this).blur(function(){
        if($(this).val()==""){
	  // $(this).addClass('hasplaceholder');
           $(this).val($(this).attr("placeholder"));
        }
       });
    }
  });

	$('form').submit(function(evt){
		$('input[placeholder]').each(function(){
			if($(this).attr("placeholder") == $(this).val()) {$(this).val('');}
		});
	});
});

//$(document).ready(function(){ 
//	$(document).pngFix(); 
//});

//accordion
//nice version
$(document).ready(function() {
	$("ul.nav li ul").prev("a").addClass("header");
	$(".dropnav").accordion({autoHeight: false, collapsible: true, active: false, header: '.header', navigation: true});
});


//sub nav bk stuff
$(document).ready(function() {
	$(".nav").accordion().parent("a").addClass("bk-selected");
	
	$("a.colbox").colorbox();
	
	$("a.colbox1").colorbox({width:"550px"});
	
	$("a.colbox2").colorbox({width:"1104px",height:"610px"});
	
	$("a.colbox3").colorbox({width:"800px",height:"700px"});
});

//text in inputBox
function clearBox(str) {
  if(document.searchForm.zoom_query.value == str) {document.searchForm.zoom_query.value = "";}
}


//////AJAX PAGE CALLS/////////
$(document).ready(function(){
	$('.class').live("click",function()
	{
		//var $id = $(this).attr('mcid');

		//$.post("script.php",  
//				   function(data){
//					   //alert( "Data Saved: " + data );
//						$("div#toupdate").html(data);
//			});
		
		return false;
		
	});
});	

// footer map
$(document).ready(function(){
	var map = new GMap2(document.getElementById("map_canvas"));
	map.setCenter(new GLatLng(53.315967,-2.661116), 15);
	point = new GLatLng(53.315967,-2.661116);
	marker = new GMarker(point);
	map.addControl(new GSmallMapControl());
	map.addOverlay(marker);
});	

//submit form
function submitForm(formid, acionurl){
		document.getElementById(formid).action = acionurl;
		document.getElementById(formid).submit();
}

//submit form
function goToURL(url){
		window.location = url;
}

$(document).ready(function(){
	$('.scroll-pane').jScrollPane(
	{
		showArrows: true
	}
	);
	$('.scroll-pane-smaller').jScrollPane(
	{
		showArrows: true
	}
	);
});

