
function mapClickForLittleMap(overlay, latlng) {
  if(overlay) {
    if(!overlay.isAdPoi)
      return;
	
    //UviewAd = true;
	var html = '<table width="80%" border="0"><tr><td>';
	
	html += overlay.name + ' to ' + overlay.cult + '</td><td>';
	if(overlay.date) html += '(' + overlay.date + ')';
    
	html += '</td></tr><tr>';
	html += '<td align="left" colspan="2">';
  	html += overlay.content;
  	html += '</td></tr>';
	if('http://'==overlay.photo.trim() || ''==overlay.photo.trim()) {
  	} else {
	  html += '<tr>';
	  html += '<td colspan="2">';
	  html += '<img src="'+overlay.photo+'" onerror="this.src=\'img/no_photo.gif\'" alt="no_photo" width="119" height="89" /><br>';
	  html += '</td></tr>';
  	}
	var theWords = '';
	if('null'==loginName) {
		theWords = '<font color="#0000FF">先登入，才能給他(她)愛的鼓勵喔~</font>';
	} else {
		theWords = '<a href="javascript:{void(0)}" onclick="Lovehits(\''+loginName+'\',\''+overlay.idkey+'\');">給他愛的鼓勵('+overlay.times+')</a>';
	}
  	html += '<tr>';
	html += '<td>';
	html += theWords;
	html += '</td>';
	
	html += '<td>';
	html += '<a href="http://www.urmap.com/event/valentine/love01.jsp" onclick="">我也要告白</a>';
	html += '</td>';
	
	html += '</tr></table>';
	
	//alert(html);
	//overlay.accountId = accountId;
	overlay.openInfoWindow(html,210,170);
  }
}

function Lovehits(theLogin,accoutnId) {	//accoutnId 就是 idkey
  peopleClickPopu = accoutnId;
  var url = 'updateHits.jsp?accountId='+accoutnId+'&loginName='+theLogin;
  //alert(url);
  U.loadByAjax(url, updateLoveHits);
  //ajaxCall(url, updateLoveHits, true);
}
function updateLoveHits(xmlhttp) {
	//alert(xmlhttp.responseText.trim());
	if('你已給過他(她)鼓勵了。' != xmlhttp.responseText.trim()){
		alert('感謝您對我的鼓勵~');
		clearPoi();
		_Umap.closeInfoWindow();
		setTimeout(SearchAll, 1500);
	} else {
		alert(xmlhttp.responseText.trim());
	}
}
function mapClickForMainMap(overlay, latlng) {
  if(overlay) {
    if(!overlay.isAdPoi)
      return;
	
    //UviewAd = true;
	var html = '<table width="80%" border="0"><tr><td>';
	
	html += overlay.name + ' to ' + overlay.cult + '</td><td>';
	if(overlay.date) html += '(' + overlay.date + ')';
    
	html += '</td></tr><tr>';
	html += '<td align="left" colspan="2">';
  	html += overlay.content;
  	html += '</td></tr>';
	if('http://'==overlay.photo.trim() || ''==overlay.photo.trim()) {
  	} else {
	  html += '<tr>';
	  html += '<td colspan="2">';
	  html += '<img src="'+overlay.photo+'" onerror="this.src=\'event/valentine/img/no_photo.gif\'" alt="no_photo" width="119" height="89" /><br>';
	  html += '</td></tr>';
  	}
	var theWords = '';
	if('null'==loginName) {
		theWords = '<font color="#0000FF">先登入，才能給他(她)愛的鼓勵喔~</font>';
	} else {
		theWords = '<a href="javascript:{void(0)}" onclick="mainLovehits(\''+loginName+'\',\''+overlay.idkey+'\');">給他愛的鼓勵('+overlay.times+')</a>';
	}
  	html += '<tr>';
	html += '<td>';
	html += theWords;
	html += '</td>';
	
	html += '<td>';
	html += '<a href="http://www.urmap.com/event/valentine/love01.jsp" onclick="">我也要告白</a>';
	html += '</td>';
	
	html += '</tr></table>';
	
	//alert(html);
	//overlay.accountId = accountId;
	overlay.openInfoWindow(html,210,170);
  }
}

function mainLovehits(theLogin,accoutnId) {
  peopleClickPopu = accoutnId;
  var url = 'event/valentine/updateHits.jsp?accountId='+accoutnId+'&loginName='+theLogin;
  //alert(url);
  U.loadByAjax(url, mainupdateLoveHits);
  //ajaxCall(url, updateLoveHits, true);
}
function mainupdateLoveHits(xmlhttp) {
	//alert(xmlhttp.responseText.trim());
	if('你已給過他(她)鼓勵了。' != xmlhttp.responseText.trim()){
		alert('感謝您對我的鼓勵~');
		clearPoi();
		map.closeInfoWindow();
		setTimeout(SearchAllvalentine, 1500);
	} else {
		alert(xmlhttp.responseText.trim());
	}
}