﻿function doQuery() {
   
  if (document.pageControl) {
    document.pageControl.jumpPage.value="";
    document.pageControl._condition.value= "";
  }
  document.frmMachi.jumpPage.value = "";
  document.frmMachi._condition.value= "";
  document.frmMachi.submit();
}

function jump(pageNo,pageCondition) {
  if (document.pageControl) {
    document.pageControl.jumpPage.value=pageNo;
    document.pageControl._condition.value= pageCondition;
  }
  document.frmMachi.jumpPage.value=pageNo;
  document.frmMachi._condition.value= pageCondition;
  document.frmMachi.submit();
}

var altDiv = document.getElementById("altlayer");
function showInfo(personalImage,hypocorism,live,personalUrl,personalIntroduction,personalInterest,createdTime) {
//改成 changeImgData 設定
//	document.getElementById("infoPersonalImage").src = "http://www.wakema.com.tw/img/customer/" + personalImage; 
	document.getElementById("infoHypocorism").innerHTML = hypocorism;
	document.getElementById("infoLive").innerHTML = live;
	document.getElementById("infoPersonalUrl").innerHTML = personalUrl;
	document.getElementById("infoPersonalIntroduction").innerHTML = personalIntroduction;
	document.getElementById("infoPersonalInterest").innerHTML = personalInterest;
	document.getElementById("infoCreatedTime").innerHTML = createdTime;
	
	altDiv.style.display = "block";
  document.onmousemove= move;
}

function changeImgData(imgSrc,w,h) {
	if (document.getElementById("infoPersonalImage")) {
  	document.getElementById("infoPersonalImage").src = imgSrc;
  	document.getElementById("infoPersonalImage").width = w;
  	document.getElementById("infoPersonalImage").height = h;
	}
}

function move(e) {
  e= e || event;
  altDiv.style.left = e.clientX+ document.documentElement.scrollLeft + 1 +"px";
  altDiv.style.top = e.clientY+ document.documentElement.scrollTop + 1 +"px";
}

function hideDiv(name) {
  document.onmousemove = null;

  if (document.getElementById(name))
    document.getElementById(name).style.display='none';
}

function openMessageWin(id, name) {
	window.open(
		'/sendMessage2Machi.jsp?receiverId='+id+"&receiverName="+name,
		'_blank',
		'toolbar=no,menubar=no,status=yes,left=250,top=100,width=450,height=360'
	);
}

function insertMachi(userid,machiid) {
  if(userid==machiid){
    alert('將自己加入成為麻吉??不會吧?這是不行的哦! ^_^');
    return;
  }else{
     openBeMachiWin(machiid);
  }
}

function openBeMachiWin(id) {
	window.open(
		'/tobeMachi.jsp?receiverId='+id,
		'_blank',
		'scrollbar=yes,toolbar=no,menubar=no,status=yes,left=250,top=50,width=500,height=550'
	);
}

function removeMachi(id,name) {
  if (!confirm("確定要將「"+name+"」，從您的麻吉名單中移除？")) return false;
  document.frmRemoveMachi.removeId.value = id;
  document.frmRemoveMachi.submit();
}

