/*
語法變換
*/
//================
//================
function check(){
	if(document.msg_input.article.value==""){
	alert("內容未填寫!");
	document.msg_input.article.focus();
	return false;
	};
}

//================
//================
function check_input(){
	var f = document.form_input.content_input;
	
	if(f.value==""){
	alert("input內容未填寫!");
	f.focus();
	return false;
	};
}

//================
//================
function check_reply(){
	var f = document.form_reply.content_reply;
	
	if(f.value==""){
	alert("reply內容未填寫!");
	f.focus();
	return false;
	};
}

//================
//================
function check_modify(){
	var f = document.form_modify.content_modify;
	
	if(f.value==""){
	alert("modify內容未填寫!");
	f.focus();
	return false;
	};
}

//================
//================
var addH=1; 
function addHeight() { 
  if (!document.getElementById('article')) return false; 
    var comment = document.getElementById('article'); 
    var nowH = parseInt(comment.style.height); 
    if (nowH < 1000) {     
        nowH+=5; 
        comment.style.height=nowH+"px"; 
        addH++; 
        if (addH > 25){  
            addH=1; 
        } else { 
        window.setTimeout("addHeight()","10"); 
        } 
    } 
} 

function minHeight() { 
  if (!document.getElementById('article')) return false; 
    var comment = document.getElementById('article'); 
    var nowH = parseInt(comment.style.height); 
    if (nowH > 50) { 
        nowH-=5; 
        comment.style.height=nowH+"px"; 
        addH++; 
        if (addH > 25){  
            addH=1; 
        } else { 
        window.setTimeout("minHeight()","10"); 
        } 
    } 
}

//================
//================
var addH=1; 
function addHeight_input() { 
  if (!document.getElementById('content_input')) return false; 
    var comment = document.getElementById('content_input'); 
    var nowH = parseInt(comment.style.height); 
    if (nowH < 1000) {     
        nowH+=5; 
        comment.style.height=nowH+"px"; 
        addH++; 
        if (addH > 25){  
            addH=1; 
        } else { 
        window.setTimeout("addHeight_input()","10"); 
        } 
    } 
} 

function minHeight_input() { 
  if (!document.getElementById('content_input')) return false; 
    var comment = document.getElementById('content_input'); 
    var nowH = parseInt(comment.style.height); 
    if (nowH > 50) { 
        nowH-=5; 
        comment.style.height=nowH+"px"; 
        addH++; 
        if (addH > 25){  
            addH=1; 
        } else { 
        window.setTimeout("minHeight_input()","10"); 
        } 
    } 
}

//================
//================
var addH=1; 
function addHeight_reply() { 
  if (!document.getElementById('content_reply')) return false; 
    var comment = document.getElementById('content_reply'); 
    var nowH = parseInt(comment.style.height); 
    if (nowH < 1000) {     
        nowH+=5; 
        comment.style.height=nowH+"px"; 
        addH++; 
        if (addH > 25){  
            addH=1; 
        } else { 
        window.setTimeout("addHeight_reply()","10"); 
        } 
    } 
} 

function minHeight_reply() { 
  if (!document.getElementById('content_reply')) return false; 
    var comment = document.getElementById('content_reply'); 
    var nowH = parseInt(comment.style.height); 
    if (nowH > 50) { 
        nowH-=5; 
        comment.style.height=nowH+"px"; 
        addH++; 
        if (addH > 25){  
            addH=1; 
        } else { 
        window.setTimeout("minHeight_reply()","10"); 
        } 
    } 
}

//================
//================
var addH=1; 
function addHeight_modify() { 
  if (!document.getElementById('content_modify')) return false; 
    var comment = document.getElementById('content_modify'); 
    var nowH = parseInt(comment.style.height); 
    if (nowH < 1000) {     
        nowH+=5; 
        comment.style.height=nowH+"px"; 
        addH++; 
        if (addH > 25){  
            addH=1; 
        } else { 
        window.setTimeout("addHeight_modify()","10"); 
        } 
    } 
} 

function minHeight_modify() { 
  if (!document.getElementById('content_modify')) return false; 
    var comment = document.getElementById('content_modify'); 
    var nowH = parseInt(comment.style.height); 
    if (nowH > 50) { 
        nowH-=5; 
        comment.style.height=nowH+"px"; 
        addH++; 
        if (addH > 25){  
            addH=1; 
        } else { 
        window.setTimeout("minHeight_modify()","10"); 
        } 
    } 
}

//================
//================
function check_price_error(){
	var f = document.add_price;

	if(f.price.value==""){
	alert("您的市價未填寫！");
	f.price.focus();
	return false;
	};
	if(f.price.value==0){
	alert("市價不可為零！");
	f.price.focus();
	return false;
	};
}


function delete_confirm()
{
var r=confirm("您確定要刪除嗎？");
if (r==false)
  {
  return false;
  };
}

//====
//====
function addsmile_input(SmileCode){  	
	document.form_input.content_input.value += ' [s:'+SmileCode+'] ';
}

function addsmile_reply(SmileCode){  	
	document.form_reply.content_reply.value += ' [s:'+SmileCode+'] ';
}

function addsmile_modify(SmileCode){  	
	document.form_modify.content_modify.value += ' [s:'+SmileCode+'] ';
}

//===
//===
function ShowLayer(LayerID) {
	if(document.getElementById(LayerID).className=="hidden") {
		document.getElementById(LayerID).className="";
		}
		else{
		document.getElementById(LayerID).className="hidden";	
		}
}