// Homepage Slideshow
$(document).ready(function() {
    $('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
});

$(document).ready(function(){
	thisPage = location.href.substring((location.href.lastIndexOf("/"))+1);
	if (thisPage.indexOf("#")>0){
		thisPage = thisPage.substring(0,thisPage.indexOf("#"));
	}
	if (thisPage.indexOf("?")>0){
		thisPage = thisPage.substring(0,thisPage.indexOf("?"));
	}
        
	$(".menu ul li a[href='"+thisPage+"']'").each(function() {
		$(this).addClass('current');
	});
	$(".menu ul li ul li a[href='"+thisPage+"']'").each(function() {
		$(this).parent().parent().parent().addClass('current');
	});

        if ($('form[name=contactForm]').length>0){
		$('.contact_col input[name=contact_name]').example('Enter your name here.');
		$('.contact_col input[name=company]').example('Enter your company name here.');
                $('.contact_col input[name=phone]').example('Enter your phone number here.');
		$('.contact_col input[name=email]').example('Enter your email here.');
                $('.contact_col textarea[name=message]').example('Enter your message here.');
	}


});

// Dropdown Menu
sfHover = function() {
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" over";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" over\\b"), "");
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover);

// Photo Galleries
$(document).ready(function(){
				  
	        $('.imglist li a').live("click",function(){
	        		imgFile = $(this).attr('href');


					//$("#imgblock").html('<img src="'+imgFile+'"/>');
					$("#imgblock img").attr('src',imgFile);
					$(".imglist ul li").removeClass('current');
					$(this).parent('li').addClass('current');
					return false;
				});
});

// Stock Gallery
$(function() {
	$('#gallery a.thumb').lightBox({fixedNavigation:true});
});
