var layer_cur_top=0;
//-----------------------------------
function hide_content() {
	$(".block").hide();
	$(".block-about").hide();
	$(".block-privacy").hide();
	$(".block-guarantee").hide();
	$(".block-download").hide();
	$(".block-faq").hide();
	$(".block-tutorial").hide();
	$(".block-veta_testing").hide();
	$("#test_progressbar").hide();
}
//-----------------------------------
$(document).ready(function() {
	//-------
	$("#dsp").css('display','');
	hide_content();
	//-------
	str=window.location.pathname;
	if(str.substring(1)=='index.html' || str.substring(1)=='') {
		$(".c-top").fadeIn('slow');
		$(".block").fadeIn('normal');
		layer_show("layer");
	} else {
		$(".block-"+(str.substring(1,str.indexOf('.html')))).fadeIn('slow');
	}
	//-------
	$("#menu-order").click(function() {
		window.location='./order.html';
	});
	//-------
	$(".mn-itm-c").click(function() {
		id=$(this).attr('id').substring(5);
		hide_content();
		window.location='./'+id+'.html';
		/*
		if(id=='index') {
			$(".c-top").fadeIn('slow');
			$(".block").fadeIn('normal');
		} else {
			$(".block-"+id).fadeIn('slow');
		}
		*/
	});
	//-------
	$(".blok-index-bottom td").mouseover(function() {
		$(this).css('cursor','pointer').css('border','4px solid red');
	});
	$(".blok-index-bottom td").mouseout(function() {
		$(this).css('border','4px solid green');
	});
	$(".blok-index-bottom td").click(function() {
		if($(this).attr('id')!='test_submit') {
			$("#menu-"+$(this).attr('id').substring(18)).click();
		} else {
			var os=document.getElementById('test_os');
			var oe=document.getElementById('test_oe');
			var ie=document.getElementById('test_ie');
			data="&name="+$("#test_name").val();
			data+="&email="+$("#test_email").val();
			data+="&os="+os[os.selectedIndex].value;
			data+="&oe="+oe[oe.selectedIndex].value;
			data+="&ie="+ie[ie.selectedIndex].value;

			$.ajax({
				type:		"POST",
				url:		"index.php",
				data:		"task=beta_test"+data,
				beforeSend:	function() {
					$(".blok-index-bottom").hide();
					$("#test_progressbar").show();
				},
				complete:	function() {
					$("#test_progressbar").hide();
				},
				success:	function(msg) {
					if(msg=='good') {
						$("#test_form").hide();
						alert('data sent successfully');
					} else {
						alert(msg);
						$(".blok-index-bottom").show();
					}
				}
			});
		}
	});
	//-------
	$(".download_button").click(function() {
		layer_show("blayer");
	});
	//-------
});