
//设置底部宽度
function setBottomWidth(width)
{
	if (document.getElementById("siteBottom") == "[object]")
	{
		document.getElementById("siteBottom").width = width;
	}
}

//是否静态页面
function isHTML()
{
	var urlhref=location.href;
	if(urlhref.indexOf(".html")!=-1 || (parent && parent.location.href.indexOf(".html")!=-1) || urlhref=="http://www.yuexiu.gov.cn/index/"){
		return true;
	}
	return false;
}

//弹出窗口
function disp(id, templet) //id为文章ID, templet为弹出窗口的模板(1:东山概况 2:东山聚焦 3:东山信息 4:旅游者 5:企业投资者 6:全文检索 7:市民 8:特色服务 9:信息化建设 10:政务分开 11:职能机构)
{
	//openNewWindow("../pop.jsp", id, templet);
	openNewWindow("/public/pop.jsp", id, templet);
}
function disp2(id, templet) //id为文章ID, templet为弹出窗口的模板(1:东山概况 2:东山聚焦 3:东山信息 4:旅游者 5:企业投资者 6:全文检索 7:市民 8:特色服务 9:信息化建设 10:政务分开 11:职能机构 12:食品安全)
{
	//openNewWindow("../pop2.jsp", id, templet);
	openNewWindow("/public/pop2.jsp", id, templet);
}



//弹出窗口(显示其他网站文章内容)
//siteUrl为外部网站的LINK
function dispSite(id, templet, siteUrl)
{
	openNewWindow("../pop_site.jsp", id, templet, siteUrl);
}

//弹出窗口
function openNewWindow(url, id, templet, siteUrl)
{
	if(templet == null)
	{
		templet = 1;
	}
	var href = "";
	if(isHTML())
	{
		href = url.substring(0,url.lastIndexOf(".")) + "_jsp_templet_" + templet + ((siteUrl != null) ? ("&url=" + siteUrl) : "") + "_id_" + id + ".html";
	}
	else
	{
		href = url + "?templet=" + templet + ((siteUrl != null) ? ("&url=" + siteUrl) : "") + "&id=" + id;
	}
	var news = window.open(href, "news", "width = 652, height = 500, scrollbars = 1, left = 25, top = 25, resizable = 1");
	news.focus();
}

//弹出图片浏览窗口
function dispPhoto(catid, id, templet) //id为图片ID, templet为弹出窗口的模板(1:东山概况 2:东山聚焦 3:东山信息 4:旅游者 5:企业投资者 6:全文检索 7:市民 8:特色服务 9:信息化建设 10:政务分开 11:职能机构)
{
	if(templet == null)
	{
		templet = 1;
	}
	var news = window.open("/pop_photo.jsp?catid=" + catid + "&templet=" + templet + "&id=" + id , "news", "width = 630, height = 530, scrollbars = 1, left = 25, top = 25, resizable = 1");
	news.focus();
}
function dispPhotos2(catid, id, templet) //id为图片ID, templet为弹出窗口的模板(1:东山概况 2:东山聚焦 3:东山信息 4:旅游者 5:企业投资者 6:全文检索 7:市民 8:特色服务 9:信息化建设 10:政务分开 11:职能机构)
{
	if(templet == null)
	{
		templet = 1;
	}
	var news = window.open("/pop_photo2.jsp?catid=" + catid + "&templet=" + templet + "&id=" + id , "news", "width = 630, height = 530, scrollbars = 1, left = 25, top = 25, resizable = 1");
	news.focus();
}

function iframeAutoSize(objStr)
{
	try
	{
		document.all[objStr].style.height = eval(objStr).document.body.scrollHeight;
	} catch (e) {}
}

//弹出邮箱登陆
function openMail(url)
{
	var mail = window.open(url, "mail", "width = 300, height = 355, scrollbars = 0, left = 25, top = 25, resizable = 0");
	mail.focus();
}
//邮箱临时公告
function openMailMessage() {
if (location.href=="http://www.yuexiu.gov.cn/index/") {
var adpop=window.open("/index/temp_message.htm","tempAd","width=300,height=200,scrollbars=0,left=25,top=25,resizeable=0");
    adpop.focus();
}
}
 //openMailMessage();
//弹出投票结果
function openVote(id)
{
	var vote = window.open("/admin/vms/show_result.jsp?titleid="+id, "vote", "width = 630, height = 500, scrollbars = 0, left = 25, top = 25, resizable = 0");
	vote.focus();
}

//tel
function openTel(url){
	var news = window.open(url, "news", "width = 652, height = 500, scrollbars = 1, left = 25, top = 25, resizable = 1");
	news.focus();
}