

function movePre(){
MoveStep=MoveStep-1;
if(MoveStep<0){
MoveStep=0;
}
viewImg(ImgSrc[MoveStep]);
for(ii=0;ii<6;ii++)
document.getElementById('thub'+ii).className="normal";
document.getElementById('thub'+MoveStep).className="thub";
}
function Copy()
{ 
var clipBoardContent='http://'+Domain+'.baby.jewelchina.com/'; 
window.clipboardData.setData("Text",clipBoardContent); 
alert("已复制本页链接,您可以使用Ctrl+V粘贴后,发送给好友!");
} 
function high(obj){
obj.className='high';
}
function lower(obj){
obj.className='lower';
}
function isShowLoginDialog(){
var cookie=getCookie('home');
if(cookie==""){
msgBox('登录会员中心：',loginString,350,250);
document.getElementById('BabyId').value=-1;
document.getElementById('vusername').focus();
$('showLoginMsg').innerHTML='&nbsp;&nbsp;&nbsp;登录后才可以留言，请先登录！</font>';
return true;
}
else{
return false;
}
}



function bodyHeight(){
	var cobj = document.body;
	while(cobj.scrollTop == 0 && cobj.parentNode) {
		if(cobj.tagName.toLowerCase() == 'html') break;
		cobj = cobj.parentNode;
	}
	return cobj.clientHeight;
}
function scrolltop(){
	var cobj = document.body;
	while(cobj.scrollTop == 0 && cobj.parentNode) {
		if(cobj.tagName.toLowerCase() == 'html') break;
		cobj = cobj.parentNode;
	}
	return cobj.scrollTop;
}
var cache_user=new Array();	
function   show(username)   
{

document.all.userinfo.style.left=event.clientX + document.body.scrollLeft;   
document.all.userinfo.style.top=event.clientY +scrolltop();
document.all.userinfo.style.display="block";    

		if(cache_user[username] != null){
			document.all.userinfo.innerHTML=cache_user[username];
		}else{
			document.all.userinfo.innerHTML='信息读取中...';
			xajax_getlyuserinfo(username);
		}    
}


function callback(user,html){
    cache_user[user]=html;
    //alert(cache_user[user]);
}



function CheckComment(){
        if(isShowLoginDialog()){
		    return false;
		}
		var comment=document.getElementById("Comment").value;
		if (comment=='' || comment==null || comment=='本评论只代表中饰网网友个人观点，不代表中饰网观点')
		{
			alert("对不起，评论不能为空！");
			document.getElementById("Comment").focus();
			return false;
		}
			var reg_number=/^\D*/;
			aa=reg_number.exec(comment)
			if(aa!=comment){
			alert("对不起，不能留含数字联系方式！");
			document.getElementById("Comment").focus();
			return false;
		  }
		
		var tmp;
		tmp=document.getElementById('Comment').value;
		var filter = /<|>|国际合作|邀函|招赘|招赘网|鼅|你妈的|不得好死|誣蔑|法輪|拆迁|勾结|你妈个B|你妈个b|操B|操b|他奶奶的|官商|大法|轉法輪|修煉|真善忍|胡锦涛|自殺|自殘|自焚|肏|乳房|性交|做爱|法轮|口交|妈的|妈b|射精|阴道|阴茎|鸡巴|台独|操你|妈逼|达赖|民运|江泽民|李宏志|李洪志|六四|中华民国|垃圾|狗屎|鸡|妓女|傻比|傻B|性交易|发骚|情妇|小妮子|他妈的|章比|章B|干比|干B|鸡|傻逼|短信投票|网络投票|专业投票|专业的投票公司|投票公司|骚样|奶子|卖比|卖B/g;
	  tmp = tmp.replace(filter,"");

	if (tmp != document.getElementById('Comment').value)
	{
		alert("请注意你的发言用词，谢谢合作。");
		//document.getElementById('Comment').value=tmp;
		document.getElementById("Comment").focus();
		return false;
	}
	if(comment.length>150){
	    alert('留言内容150个字符以内。您的当前字数：'+comment.length);
		document.getElementById("Comment").focus();
		return false;
	}
	$("Scroll").innerHTML="";
	 xajax_saveComment(xajax.getFormValues('commentForm'));
	return false;
}
function viewImg(src){
	   document.getElementById('ShowImg').src="resize.php?width=380&height=507&img="+src;
	   
	}
	function change_code(){
		document.getElementById('Code').src="validateCode.php?"+Math.random();
		
	}
	function facePreview(obj){
	      obj.className='face1';
	}
	function unFacePreview(obj){
	    obj.className='face2';
	}
	function setFace(obj){
	    var comment=document.getElementById("Comment");
		if(comment.value=='本评论只代表中饰网网友个人观点，不代表中饰网观点'){
		    comment.value='';
		}
		//comment.value=comment.replace('本评论只代表中饰网网友个人观点，不代表中饰网观点','');
		comment.value+=obj.tag;
	}
	var currentShortWord="选择常用短语...";
	function setValue(){
	   var comment=document.getElementById("Comment");
		if(comment.value=='本评论只代表中饰网网友个人观点，不代表中饰网观点'){
		    comment.value='';
		}
		//document.getElementById('aaaaaa').innerHTML=comment.value;
		//alert(document.getElementById('shortWord').value);
		if(document.getElementById('shortWord').value !="选择常用短语..." && document.getElementById('shortWord').value!=currentShortWord ){
		   // document.getElementById('aaaaaa').innerText=document.getElementById('shortWord').value;
		    comment.value =comment.value +document.getElementById('shortWord').value +"  ";
			currentShortWord=document.getElementById('shortWord').value;
		}
		
		
	}
	
	function copyPingUrl(){
	    var data= document.getElementById('ShowImg').src;
		window.clipboardData.setData("Text",data); 
		alert("已复制图片链接,您可以使用Ctrl+V粘贴图片地址!");
		
	}