//右侧栏与左边内容 高度保持一致
function setHeight(){

	if (document.getElementById('right_Content'))
	{
		var left_column_height = document.getElementById('left_Content').scrollHeight;
		var inner_main_height = document.getElementById('right_Content').scrollHeight;
		(left_column_height>inner_main_height) ? (Height=left_column_height) : (Height=inner_main_height);
		document.getElementById('left_Content').style.height = Height + "px" ;
		document.getElementById('right_Content').style.height = Height + "px" ;
	}

}
//复制URL地址
function setCopy(_sTxt){
	if(navigator.userAgent.toLowerCase().indexOf('ie') > -1) {
		clipboardData.setData('Text',_sTxt);
		alert ("医院网址“"+_sTxt+"”\n已经复制到您的剪贴板中\n您可以使用Ctrl+V快捷键粘贴到需要的地方");
	} else {
		prompt("请复制医院网址:",_sTxt);
	}
}
//加入收藏
function addBookmark(site, url){
	if(navigator.userAgent.toLowerCase().indexOf('ie') > -1) {
		window.external.addFavorite(url,site)
	} else if (navigator.userAgent.toLowerCase().indexOf('opera') > -1) {
		alert ("请使用Ctrl+T将本页加入收藏夹");
	} else {
		alert ("请使用Ctrl+D将本页加入收藏夹");
	}
}
//更改分类显示状态
function messageAdd(message){
	if(message=="")
	{
		alert("你忘记写留言内容了吧？~呵呵");
	}
	else
	{
		$("#newSuggestion input").attr("disabled","disabled");
		$("#newSuggestion textarea").attr("disabled","disabled");
		$("#newSuggestion h4").html("正在提交留言数据...");
		$.ajax({
			type: "POST",
			url: "ajax/message_add.php",
			data: "message="+message+"",
			success: function(data){
				$("#newSuggestion h4").fadeIn(1000).html("留言成功！你可以再写一条留言~");
				$("#newSuggestion input").removeAttr("disabled");
				$("#newSuggestion textarea").removeAttr("disabled").val("");
				tmp_html = $("#suggestionList ol").html();
				$("#suggestionList ol").html(data).append(tmp_html);
			},
			error: function(){
				$("#newSuggestion h4").html("留言失败，请重试！");
				$("#newSuggestion input").removeAttr("disabled");
				$("#newSuggestion textarea").removeAttr("disabled");
			}
		});
	}
}
//搜索验证
function checkSearch()
{
	//tmp_val = $("#sugSearch input[@type=text]").val();
	tmp_val = $("#sugSearch input[type=text]").val();
	if(tmp_val == "" || tmp_val == "再此输入意见反馈关键字...")
	{
		alert("请输入一些你要搜索的文字");
		return false;
	}
}

//交通位置图 最大宽度设定
function set_image_width(fix_width)
{
	var image=new Image();
	image.src=$(".traffic_image img").attr("src");
	if( image.width > fix_width )
	{
		$(".traffic_image").html("<a href=\""+image.src+"\" target=\"_blank\"><img width=\""+fix_width+"\" src=\""+image.src+"\" title=\"点击查看完整交通位置图\" alt=\"点击查看完整交通位置图\" \/><\/a>");	
	}
}