function popupCal(openPage,targetElement){
	//alert("1");
	//alert(targetElement);
	//alert(window.event.srcElement.name);
	window.open(openPage+"?te="+targetElement,"calendar","height=300, width=200, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no");//top=100, left=100,
	//alert("2");
}	

//显示/隐藏装修日记文章全文
function showArticle(arg){			
	//alert(document.getElementById(arg1).innerHTML);
	//alert(this.onclick);
	if(document.getElementById("article_"+arg).innerHTML==""){
		document.getElementById("article_"+arg).innerHTML=document.getElementById("hidden_"+arg).value;
		//alert(document.getElementById(arg1).innerHTML);				
	}else{
		document.getElementById("article_"+arg).innerHTML="";				
	}
}

//显示/隐藏业主评价评语
function showEvaluate(arg){
	//alert(document.getElementById("index1_"+arg).innerHTML);
	if(document.getElementById("index1_"+arg).innerHTML==""){
		document.getElementById("index1_"+arg).innerHTML=document.getElementById("hidden1_"+arg).value;
		document.getElementById("index2_"+arg).innerHTML=document.getElementById("hidden2_"+arg).value;
		document.getElementById("index3_"+arg).innerHTML=document.getElementById("hidden3_"+arg).value;
		document.getElementById("index4_"+arg).innerHTML=document.getElementById("hidden4_"+arg).value;
		document.getElementById("index5_"+arg).innerHTML=document.getElementById("hidden5_"+arg).value;		
	}else{
		document.getElementById("index1_"+arg).innerHTML="";
		document.getElementById("index2_"+arg).innerHTML="";
		document.getElementById("index3_"+arg).innerHTML="";
		document.getElementById("index4_"+arg).innerHTML="";
		document.getElementById("index5_"+arg).innerHTML="";
	}
}

//弹出窗口显示业主评价评语
function popupEvaluate(arg){
	alert(document.getElementById("index1_"+arg).innerHTML);
	window.open ("show_vend_evaluate.jsp?arg="+arg, "vendevaluate", "height=300, width=500, top=100, left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no");
	//if(document.getElementById("index1_"+arg).innerHTML==""){
	//	document.getElementById("index1_"+arg).innerHTML=document.getElementById("hidden1_"+arg).value;
	//	document.getElementById("index2_"+arg).innerHTML=document.getElementById("hidden2_"+arg).value;
	//	document.getElementById("index3_"+arg).innerHTML=document.getElementById("hidden3_"+arg).value;
	//	document.getElementById("index4_"+arg).innerHTML=document.getElementById("hidden4_"+arg).value;
	//	document.getElementById("index5_"+arg).innerHTML=document.getElementById("hidden5_"+arg).value;		
	//}else{
	//	document.getElementById("index1_"+arg).innerHTML="";
	//	document.getElementById("index2_"+arg).innerHTML="";
	//	document.getElementById("index3_"+arg).innerHTML="";
	//	document.getElementById("index4_"+arg).innerHTML="";
	//	document.getElementById("index5_"+arg).innerHTML="";
	//}
}

// Scrolling the business show DIVs
function scrollup(o,d,c){
	if(d<=c){
		var t=o.firstChild.cloneNode(true);
		o.removeChild(o.firstChild);
		o.appendChild(t);
		t.style.marginTop=o.firstChild.style.marginTop="0px";
	} else{
		var s=7, c=c+s, l=(c>=d?c-d:0); 
		o.firstChild.style.marginTop=-c+l+"px";
		window.setTimeout(function(){scrollup(o,d,c-l)},100); 
	}
}

// Initialize scrolling DIVs for business show
function initScrollingDIVs(){
	var oTend=document.getElementById("tendDiv");
	mrTend=window.setInterval(function(){scrollup(oTend,140,0);},10000);
	tendDiv.onmouseover=function() {clearInterval(mrTend)}
	tendDiv.onmouseout=function() {mrTend=setInterval(function(){scrollup(oTend,140,0);},10000)}

	var oOper=document.getElementById("operDiv");
	mrOper=window.setInterval(function(){scrollup(oOper,140,0);},10000); 
	operDiv.onmouseover=function() {clearInterval(mrOper)} 
	operDiv.onmouseout=function() {mrOper=setInterval(function(){scrollup(oOper,140,0);},10000)}
}

function showEditDiv(){
	showPos(document.getElementById("edit"),'edittd',-100,0);
	document.getElementById("edit").style.visibility="visible";
}

function closeEditDiv(){
	document.getElementById("edit").style.visibility="hidden";		
}

function monitorSites(prepareTenderDealURL){
	// Popup modal or modalless dialog ?
	//<INPUT type="button" value="New Window!" onClick="window.open('http://www.pageresource.com/jscript/jex5.htm','mywindow','width=400,height=200,toolbar=yes, 
	//location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, 
	//resizable=yes')"> toolbar=no,location=no,stauts=yes,menubar=no,scrollbars=no,resizable=no
	window.showModalDialog(prepareTenderDealURL, window, 'dialogWidth:680px;dialogHeight:360px;');
}

function prepareReRecommend(prepareURL){
	window.showModalDialog(prepareURL, window, 'dialogWidth:680px;dialogHeight:240px;');
}

function prepareAdminPointMgmt(prepareURL){
	window.showModalDialog(prepareURL, window, 'dialogWidth:680px;dialogHeight:640px;');
}

function openVendor(frm, vendid){
	frm.action = "adminListVendBusiness.do";
	frm.vendorid.value = vendid;
	frm.submit();	
}