$("document").ready(function() {
 	$('#slides').slides({
		play: 4000,
		preload: true,
		generateNextPrev: true
	});

	var checkListImages;
	if($("#mainimages").children().length > 0) {
		sl = new Array();
		checkListImages = $("#mainimages").children();
		$("#mainimages").children().each(function () {
			$(this).hide();
			sl[sl.length] = {image:$(this).attr("href")}
		});
		if(sl.length > 0) {
			$.fn.supersized.options = {  
				startwidth: 640,  
				startheight: 480,
				vertical_center: 0,
				slideshow: 1,
				navigation: 1,
				fit_landscape : 0,
				thumbnail_navigation: 0,
				transition: 1, //0-None, 1-Fade, 2-slide top, 3-slide right, 4-slide bottom, 5-slide left
				pause_hover: 0,
				slide_captions: 1,
				slide_interval: 3000,
				slides : sl
			};
		    $('#supersized').supersized(); 
		}
	}
	
	$("a table").each(function() {
		$(this).click(function() {
			//console.log($(this).attr("id"));
			pa = $(this).parent("a").eq(0);
			if(pa.attr("id") == "block10") {
				
			} else {
				if(pa.hasClass("findform")) {
					
				} else {
					document.location.href = pa.attr("href");
				}
			}
		});
	});
	
	if($.browser.msie) {
		
	} else {
		$(".getform").css('zIndex', 11000);
		initLightbox();
	}
	
	$('a.closeForm').live('click', function() {
		$("#"+$(this).closest('div.getform').attr("id")).hide();
	});
		
});

