$(document).ready(function() {

	$(document).pngFix();

	$(".sub_content a").attr("target","_blank");

	$("#header .logo").click(function(){
		document.location.href='index.php';
	});
	$("#middle .subscribe").css("opacity", 0.6);
	$("#gnv a").mouseover(function(){
		tmp=$(this).attr("class");
		$("#gnv ."+tmp+"_dot .menu_dot").css("margin-top",0);
	});
	$("#gnv a").mouseout(function(){
		tmp=$(this).attr("class");
		$("#gnv ."+tmp+"_dot .menu_dot").css("margin-top",10);
	});
/*
	$("#gnv div.menu div").mouseover(function(){
		$(this).attr("overed","1");
		$(this).animate({marginTop:0},200);
	});
	$("#gnv div.menu div").mouseout(function(){
		tmp=$(this).attr("class");
		$(this).attr("overed","0");
		setTimeout("hidemenu('"+tmp+"')",300);
	});
*/
	$(".banner li").mouseover(function(){
		$(this).css("background-position","0 100%");
	});
	$(".banner li").mouseout(function(){
		$(this).css("background-position","0 0");
	});
	$(".banner li.banner1").click(function(){
		window.open("http://thailand.yourworkshops.com.au");
	});
	$(".banner li.banner2").click(function(){
		window.open("http://thailandjingjing.blogspot.com");
	});
	$(".banner li.banner3").click(function(){
		window.open("http://tourismthailand.org/");
	});

	//$("#footer .dot").css("background-position-y",10);

	$("#ContactUs").mouseover(function(){
		$("#footer .contact").css("margin-top",0);
	});
	$("#ContactUs").mouseout(function(){
		$("#footer .contact").css("margin-top",10);
	});
	$("#TermOfUse").mouseover(function(){
		$("#footer .term").css("margin-top",0);
	});
	$("#TermOfUse").mouseout(function(){
		$("#footer .term").css("margin-top",10);
	});

	$("#btn_subscribe").click(function(){
		$("#subscribe_form").submit();
	});


});

function hidemenu(tmp){
	obj="#gnv div.menu div."+tmp;
	if($(obj).attr("overed")=="0"){
		$(obj).animate({marginTop:7},100);
	}
}