function StopButton(){
	document.getElementById(arguments[0]).disabled=true;
	document.getElementById(arguments[0]).value="提交("+arguments[1]+")";
	if(--arguments[1]>0){
		window.setTimeout("StopButton('"+arguments[0]+"',"+arguments[1]+")",1000);
	}
	if(arguments[1]<=0){
		document.getElementById(arguments[0]).value='提交';
		document.getElementById(arguments[0]).disabled=false;
	}
}
function GetComment(value,$Page){
	$.ajax({
		url:"/ajax/?mode=2&page="+$Page+"&time"+new Date().toString(),
		type:'GET',
		success:function(){
			$('#comment').html(arguments[0]);
		}
	});
}
function GetNewsList(value,$Page){
	$.ajax({
		url:"/ajax/?mode=3&page="+$Page+"&time"+new Date().toString(),
		type:'GET',
		success:function(){
			$('#Newslist').html(arguments[0]);
		}
	});
}
function GetNewsHomelist(){
	$.ajax({
		url:"/ajax/?mode=5&time"+new Date().toString(),
		type:'GET',
		success:function(){
			$('#NewsHomelist').html(arguments[0]);
		}
	});
}
function GetAdHomelist(){
	$.ajax({
		url:"/ajax/?mode=8&time"+new Date().toString(),
		type:'GET',
		success:function(){
			$('#ADHomelist').html(arguments[0]);
		}
	});
}
function GetNewsDetails(){
	$.ajax({
		url:"/ajax/?mode=6&id="+ Request("id")+"&time"+new Date().toString(),
		type:'GET',
		success:function(){
			$('#NewsDetails').html(arguments[0]);
		}
	});
}
function Intro(ID){
 var IntroList="Intro"+ID;
	$.ajax({
		url:"/ajax/?mode=7&id="+ ID+"&time"+new Date().toString(),
		type:'GET',
		success:function(){
			$('#'+IntroList).html(arguments[0]);
		}
	});
}
function SendComment(){	
		var $CommentParentID	=arguments[0];
		var $CommentUser		=$('#CommentUser').val();
		var $CommentText		=$('#CommentText').val();
		var $CommentEmail	=$('#txtEmail').val();
		var $CommentTel	=$('#txtTel').val();
		
		if ($.trim($CommentUser)=='')
		{
			alert('请您填写昵称！');
			$('#CommentUser').focus();
			return false;
		}
		if ($.trim($CommentEmail)=='')
		{
			alert('请您填写Email！');
			$('#txtEmail').focus();
			return false;
		}
		if ($.trim($CommentTel)=='')
		{
			alert('请您填写联系电话！');
			$('#txtTel').focus();
			return false;
		}			
		if ($.trim($CommentText)=='')
		{
			alert('请您填写回复内容！');
			$('#CommentText').focus();
			return false;
		}
		if ($CommentText.length<5||$CommentText.length>200)
		{
			alert('内容必须在5-200字之间！');		
			return false;
		}
		StopButton('CommentSubmit',10);
	    $.ajax({
		url:"/ajax/?mode=1&username="+escape($CommentUser)+"&content="+escape($CommentText)+"&email="+escape($CommentEmail)+"&tel="+escape($CommentTel)+"&time="+new Date().toString(),
		type:'GET',
		success:function(){
			
				GetComment($CommentParentID,1);
				alert(arguments[0]);
				$("#CommentText").val("");
				$('#CommentUser').val("");
				$('#txtEmail').val("");
				$('#txtTel').val("");
		}
	});

}
function Request(strName)
{
    var strHref = window.document.location.href;
    var intPos = strHref.indexOf("?");
    var strRight = strHref.substr(intPos + 1);

    var arrTmp = strRight.split("&");
    for(var i = 0; i < arrTmp.length; i++)
    {
        var arrTemp = arrTmp[i].split("=");

        if(arrTemp[0].toUpperCase() == strName.toUpperCase()) return arrTemp[1];
    }
    return "";
}
function LinkUrl(URL,id){	
		
	    $.ajax({
		url:"/ajax/?mode=4&id="+escape(id)+"&time="+new Date().toString(),
		type:'GET',
		success:function(){
         window.open(URL);
		}
	});

}
Intro(1);
Intro(2);
Intro(3);
Intro(4);
Intro(5);
Intro(6);
Intro(7);
Intro(8);
Intro(9);
Intro(10);
Intro(11);