// JavaScript Document

$(document).bind("contextmenu",function(e){
//	return false;
});

function close_welcome(str)
{
	swfobject.embedSWF("/flash.swf?<?=rand()?>", "flashcontent", "866", "420", "10","expressInstall.swf", flashvars, params, attributes);
	$("#welcome").fadeOut(500);
}

$("document").ready( function()
{
//		$("#body_inside").animate({marginTop:500},0);
//		$("#body_inside").animate({marginTop:0},1000);
		

		$("img[src*='_hd_']").animate({opacity:0},0);
		$("img[src*='_hd_']").animate({opacity:1},1500);

		
		$("#home_green").hover( 
			function() 
			{
				$(this).attr("src", "/i/home_green_active.png");
			} 
			, function() 
			{ 
				$(this).attr("src", "/i/home_green.png");			
			} 
		);
		
		$("#check_email").hover( 
			function() 
			{
				$(this).attr("src", "/i/check_email_active.png");
			} 
			, function() 
			{ 
				$(this).attr("src", "/i/check_email.png");			
			} 
		);
		
		$("#welcome_logo").click( function() { 	$("#welcome").fadeOut(500);	} 	);

		$("#welcome_logo img").hover( 
			function() 
			{ 
				$("#welcome_fader").animate({opacity:1},500);
			} 
			,
			function() 
			{ 
				$("#welcome_fader").animate({opacity:0},500);
			} 
		);

		$("#welcome_fader").animate({opacity:0},0);
		$("#welcome_copyright").animate({opacity:0},0);
		$("#welcome_copyright").delay(500).animate({opacity:1},2000);
		
		$("#welcome_logo").animate({opacity:0},0);
		$("#welcome_logo").delay(500).animate({opacity:1},2000);
		
		
		//BOD
		
		$(".a1").colorbox({width:"80%", inline:true, href:"#a1_body"});
		$(".a2").colorbox({width:"80%", inline:true, href:"#a2_body"});
		$(".a3").colorbox({width:"80%", inline:true, href:"#a3_body"});
		$(".a4").colorbox({width:"80%", inline:true, href:"#a4_body"});
		$(".a5").colorbox({width:"80%", inline:true, href:"#a5_body"});
		$(".a6").colorbox({width:"80%", inline:true, href:"#a6_body"});
		$(".a7").colorbox({width:"80%", inline:true, href:"#a7_body"});
		$(".a8").colorbox({width:"80%", inline:true, href:"#a8_body"});
		$(".a9").colorbox({width:"80%", inline:true, href:"#a9_body"});


		$(".b1").colorbox({width:"645", inline:true, href:"#b1_body"});
		$(".b2").colorbox({width:"645", inline:true, href:"#b2_body"});
		$(".b3").colorbox({width:"645", inline:true, href:"#b3_body"});
		$(".b4").colorbox({width:"645", inline:true, href:"#b4_body"});
		$(".b5").colorbox({width:"645", inline:true, href:"#b5_body"});
		$(".b6").colorbox({width:"645", inline:true, href:"#b6_body"});
		$(".b7").colorbox({width:"645", inline:true, href:"#b7_body"});
		$(".b8").colorbox({width:"645", inline:true, href:"#b8_body"});
		$(".b9").colorbox({width:"645", inline:true, href:"#b9_body"});

		
		// reset css & fix error
		$("#hd span").css({opacity:0,display:"block"});
		$("#hd div").css({opacity:0,display:"block"}).slideUp(0);
		
		$("#hd li").hover
		(
			function()
			{
				$(this).css({"z-index":301});
				$(this).find("span").stop().animate({opacity:1},50)
				$(this).find("div").stop().slideDown(0).animate({opacity:1},300)
			}
			,
			function()
			{
				$(this).css({"z-index":300});
				$(this).find("span").stop().animate({opacity:0},300)
				$(this).find("div").stop().animate({opacity:0},200).slideUp(0)
			}
		);
		
		// for touch screen to show the sub menu
		$("#hd li").click( 
			function() 
			{ 
				$(this).css({"z-index":301});
				$(this).find("span").stop().animate({opacity:1},50)
				$(this).find("div").stop().slideDown(0).animate({opacity:1},300)
			} 
		);


});

