﻿
//更改字体大小
var status0='';
var curfontsize=10;
var curlineheight=18;
function fontZoomA(size){
	if(size)
	{
		curfontsize=size;
		curlineheight=size+8;
	}
  if(curfontsize>8){
    document.getElementById('idShow').style.fontSize=(--curfontsize)+'pt';
	document.getElementById('idShow').style.lineHeight=(--curlineheight)+'pt';
  }
}
function fontZoomB(){
  if(curfontsize<64){
    document.getElementById('idShow').style.fontSize=(++curfontsize)+'pt';
	document.getElementById('idShow').style.lineHeight=(++curlineheight)+'pt';
  }
}

String.prototype.trim = function() 
{ 
return this.replace(/(^\s*)|(\s*$)/g,""); 
} 

//Ajax处理函数
function getFormAsString(formName){
 	returnString ="";
 	formElements=document.forms[formName].elements;
 	for ( var i=formElements.length-1; i>=0; --i ){
	if(formElements[i].type=="checkbox")
	{
		if(formElements[i].checked)
			returnString=returnString+"&"+encodeURI(formElements[i].name)+"="+encodeURI(formElements[i].value);
	}
	else
		returnString=returnString+"&"+encodeURI(formElements[i].name)+"="+encodeURI(formElements[i].value);
 	}
 	return returnString; 
 }
 
function getXMLHttpRequest() {
    var xmlHttp;
	if (typeof ActiveXObject != "undefined"){
		try {
		  xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e){
		  try {
		    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		  } catch (e2) {
		  	alert("创建XMLHttpRequest对象失败！");
		    xmlHttp = false;
		  }
		}
	}else if (window.XMLHttpRequest) {
		xmlHttp=new XMLHttpRequest();
	}else{
		alert("创建XMLHttpRequest对象失败！");
		xmlHttp = false;
	}
    return xmlHttp;
}
 
function getAjax(url,methodName,postType)
{
	xmlHttp=getXMLHttpRequest();
	if (xmlHttp) {   
	    if(!postType)
	    postType="GET";
	    var varAsync;
	    if(methodName.toLowerCase()=="false")
	        varAsync=false;
	    else
	        varAsync=true;
        xmlHttp.open(postType, url, varAsync);
        xmlHttp.setRequestHeader( "Content-Type", "text/html;charset=UTF-8" );//文本形式
        if(methodName.toLowerCase()!="false")
        xmlHttp.onreadystatechange = eval(methodName);
        xmlHttp.send();
      }
}
///ajax处理函数结束


///打开浏览窗口
var currentImageTextID;

//FCKEditor的文件浏览窗关闭后，会调用此函数，并把所选图片的url传入。
function SetUrl(url){
  document.getElementById(currentImageTextID).value=url;
}

//imageTextID: 图片文本框的ID值
//uploadPath: 服务器的图片目录
//type: 浏览类型，值可为Image/Flash/File/Media，如果为空字串，则表示浏览所有类型的文件
function OpenImageBrowser(imageTextID, uploadPath, type ) {
  currentImageTextID = imageTextID;
  window.open('/images/fckeditor/editor/filemanager/browser/default/browser.html?uploaded='+uploadPath +'&Type='+type+'&Connector=../../connectors/aspx/connector.aspx','UploadImages','toolbar=no,status=no, resizable=yes,dependent=yes, scrollbars=yes,width=600,height=400')
}

function hide(obj)
{
	document.getElementById(obj).style.display="none";
}
function show(obj)
{
	document.getElementById(obj).style.display="block";
}


function home_show(n){
		
var tli=document.getElementById("anounceTitle").getElementsByTagName("li");
var cli=document.getElementById("aounceContent").getElementsByTagName("ul");

for(i=0;i<cli.length;i++){
cli[i].style.display=i==n?"block":"none";
 if(n==0){
 tli[0].className="home_yingxiao_select";
 tli[1].className="home_anounce";
 tli[2].className="home_news";
 }
 else if(n==1){
 tli[0].className="home_yingxiao";
 tli[1].className="home_anounce_select";
 tli[2].className="home_news";
 }
 else if(n==2){
 tli[0].className="home_yingxiao";
 tli[1].className="home_anounce";
 tli[2].className="home_news_select";
 }
}
}  
