/**
 * @author hecm
 */
var KWebApp = {
	/**
	 * @brief	主程序入口
	 */
	WebMain: function()
	{
		KWebApp.InitPage();
		KWebApp.InitEvent();
		KWebApp.PreloadImg();
	},
	
	InitPage: function()
	{
	
	},
	
	InitEvent : function()
	{
		$("#BtnFeedBackSubmit").mouseover(function()
		{
			$(this).css("background-image","url('images/submit_hover.gif')");
		}).mousedown(function()
		{
			$(this).css("background-image","url('images/submit_down.gif')");
		}).mouseout(function()
		{
			$(this).css("background-image","url('images/submit_normal.gif')");
		}).click(function()
		{
			var strMsg  = $("#TextFeedBack").val();
			var strLink = $("#Msg_Link").val();
			var strUuid = $("#uuid").val();
			var strApp 	= $("#app").val();
			
			if (!(strMsg.length > 0 && strMsg.length <= KWebApp._iMax_))
			{
				alert("建议内容在1-200字内!")
				return;
			}
		
			if (strLink.length > KWebApp._uMax_)
			{
				alert("联系方式在100字内!")
				return;
			}
			
			var strHost = "http://labs.duba.net/kws/interact/accept.php?app="+strApp+"&info=" + encodeURIComponent(strMsg) + "&u=" + encodeURIComponent(strLink) + "&uuid=" + strUuid;
			
			$("#FeedBackIframe").attr("src",strHost);
			
			$("#FeedBackIframe").load(function()
			{
				$("#TextFeedBack").val("");
				$("#Msg_Link").val("");
				$("#FeedBackIframe").src = "";
				$("#FeedBackIframe").unbind("load");
				window.location.reload();
			});
		});
	},
	
	PreloadImg: function()
	{
	
	},
	_iMax_ : 200 ,
	_uMax_ : 100 
}
