//home page jquery initialization
$(document).ready(function(){
	//mainpage, set wrapper height to browser height
	//alert(parseInt(jQuery.browser.version) > 500);
	//fix footer position
	/*h = $("#wrapper").height();*/
	h = 609;
	w = $("#wrapper").width();
	$(".footer").css({
		position: "absolute",
		top: (h-20)+"px"
	});
	//-
	
	//text rotator
	$(".loewyRotateText").loewyRotateText({
		delay: 13000,
		fadeOutSpeed: 13000,
		fadeInSpeed: 1000
	});
	//-
	
	//dropdown menu - comment form
	$("#sendcomment").find(".loewDropDownMenu").loewyDropDownMenu({
		width: 150,
		slideUpSpeed: 300,
		slideDownSpeed: 400
	});
	//-
	
	//dropdown menu - work menu
	$("#homenav").find(".loewDropDownMenu").loewyDropDownMenu({
		width: 115,
		slideUpSpeed: 300,
		slideDownSpeed: 400
	});
	
	//Sort by dropdown menu
	if ($.loewy.dropDownMenu) {
		$("#homenavWork").find("li.menuitem").mousedown(function(e) {
			//loadSortList($(this).attr("rel"));
			
			rel = $(this).attr("rel");
			if (rel != undefined && rel != "") {
				document.location.href = "/work/"+rel+"/";
			}
		});
	} else {
		$("#homenavWork").find("select").find("option").click(function(e) {
			//loadSortList(this.value);
			rel = this.value
			if (rel != undefined && rel != "") {
				document.location.href = "/work/"+rel+"/";
			}
		});
	}
	
	//-
	
	//homenav
	$(".homenavMenuItem","#homenav").loewyGridMenu({
		showDuration: 500,
		hideDuration: 500,
		animType: 1,
		backgroundColor: "#1A314F",
		easeShow:"easeInQuad",
		easeHide:"easeOutQuad"
	});
	//-
});
