function doClick_jy(o){
	 o.className="current";
	 var j;
	 var id;
	 var e;
	 for(var i=1;i<=6;i++){
	   id ="jy"+i;
	   j = document.getElementById(id);
	   e = document.getElementById("jy_con"+i);
	   if(id != o.id){
	   	 j.className="";
	   	 e.style.display = "none";
	   }else{
		e.style.display = "block";
	   }
	 }
	 }


function tabit(btn){
	var idname = new String(btn.id);
	var s = idname.indexOf("_");
	var e = idname.lastIndexOf("_")+1;
	var tabName = idname.substr(0, s);
	var id = parseInt(idname.substr(e, 1));
	var tabNumber = btn.parentNode.childNodes.length;
	for(i=0;i<tabNumber;i++){
			document.getElementById(tabName+"_div_"+i).style.display = "none";
			document.getElementById(tabName+"_btn_"+i).className = "";
		};
		document.getElementById(tabName+"_div_"+id).style.display = "block";
		btn.className = "curr";
};

function ReferCheckImg(id)
{
    var obj = document.getElementById('imgyzm');
    obj.src = "/Inc/Code.asp"
}

function RecommendToFriend()
{
    clipboardData.setData('text', '欢迎来到 宁海人 分享城市生活信息 '+location.href)
    window.alert('地址已复制,请直接粘贴发给MSN/QQ好友!')
}

function eaddplface(tag) {
        var myField;
        if (document.getElementById('content') && document.getElementById('content').type == 'textarea') {
                myField = document.getElementById('content');
        }
        else {
                return false;
        }
        if (document.selection) {
                myField.focus();
                sel = document.selection.createRange();
                sel.text = tag;
                myField.focus();
        }
        else if (myField.selectionStart || myField.selectionStart == '0') {
                var startPos = myField.selectionStart;
                var endPos = myField.selectionEnd;
                var cursorPos = endPos;
                myField.value = myField.value.substring(0, startPos)
                                          + tag
                                          + myField.value.substring(endPos, myField.value.length);
                cursorPos += tag.length;
                myField.focus();
                myField.selectionStart = cursorPos;
                myField.selectionEnd = cursorPos;
        }
        else {
                myField.value += tag;
                myField.focus();
        }
}

var j$=function(id) {
	var itm = null;
	if (document.getElementById) {itm = document.getElementById(id);}
	else if (document.all) {itm = document.all[id];}
	else if (document.layers) {itm = document.layers[id];}
	return itm;
}
var getByName=function(_name) {	return document.getElementsByName(_name);}

var quoteMode=0; //1为可以嵌套引用 0为否
function reply(id,userName,postTime,oDvEdit){
	if (j$('textstyle_'+id) && oDvEdit)
	{
		var contentDiv = j$('textstyle_'+id);
		var content;
		if (quoteMode==0){
			try	{
				var quoteDiv = document.createElement("div");
				quoteDiv.innerHTML = contentDiv.innerHTML;
				var elem = quoteDiv.getElementsByTagName("div");
				for (var i=0;i<elem.length;i++){
					if (elem[i].className.toLowerCase()=="quote"||-1!=elem[i].className.toLowerCase().indexOf("first_body")){
						quoteDiv.removeChild(elem[i]);
					}
				}
				var getImg = quoteDiv.getElementsByTagName("img");
				for (var i=0;i<getImg.length;i++){
					getImg[i].removeAttribute("onload");
				}
				content = quoteDiv.innerHTML;				
			}
			catch (e){}			
		}
		else{
			var getImg = contentDiv.getElementsByTagName("img");
			for (var i=0;i<getImg.length;i++){
				getImg[i].removeAttribute("onload");
			}
			content = contentDiv.innerHTML;
		}
		content = content.replace(/\<script[\s\S]*?\<\/script\>/gi,"");

		oDvEdit.clear();
			oDvEdit.insert('<div class=quote><b>以下是引用<i>'+userName+'</i>在'+postTime+'的发言：</b><br>'+content+'</div><p></p>');
	
	}	
}

function resizepic(o)
{ 
var maxwidth=480;   //定义最大宽度
var maxheight=1000;  //定义最大高度
var a=new Image();
a.src=o.src
if(a.width > maxwidth)
{
  o.style.width=maxwidth;
}
if (a.height> maxheight)
{
  o.style.height=maxheight;
 }
}
function bbimg(o)
{
  var zoom=parseInt(o.style.zoom, 10)||100;
  zoom+=event.wheelDelta/12;
  if (zoom>0) o.style.zoom=zoom+'%';
  return false;
}