function chkdel(a,b){
	if(confirm("確定要刪除此相片嗎?")){
		location.href='interface_photo.asp?action=del&id='+a+'&emp_id='+b;
	}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//轉寄時，取得會員交友id
function SelectFriendMail(a){
	var friName;
	friName="";
	if (a==1){
		if(form.chkfri.checked==true){
				friName=form.chkfri.value;
		}
	
	}else{
		for (i=0;i<a;i++){
			//alert(document.form.chkfri[i].value);
			if(document.form.chkfri[i].checked==true){
				friName+=document.form.chkfri[i].value+",";
			}
		}
	}
	
	opener.document.form.mail.value = friName.substring(0,friName.length-1);
	window.close();
}

//檔案interface_photo_mail.asp，轉寄相本
function chkform(){
	if(form.mail.value==""){
		alert("請填寫轉寄對象");
		form.mail.focus();
		window.event.returnValue=false;
	}else if(form.txt.value==""){
		alert("請填寫內容");
		form.txt.focus();
		window.event.returnValue=false;
	}
}


//檔案interface_photo_msg.asp  /  interface_note.asp
function chkformMsg(){
	if(form.txt.value==""){
		alert("請輸入內容");
		form.txt.focus();
		window.event.returnValue=false;		
	}
}
function emoticon(text) {
	text = ' ' + text + ' ';
	if (document.form.txt.createTextRange && document.form.txt.caretPos) {
		var caretPos = document.form.txt.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
		document.form.txt.focus();
	} else {
		document.form.txt.value  += text;
		document.form.txt.focus();
	}
}
function storeCaret(textEl) {
	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}




//檔案interface_photo_photo.asp
function chkpic(){
	p1=document.frmUp.Pic1.value;
	p1=p1.toLowerCase();
	if (p1!="" ){
		s=p1.split(".");
		l=s.length-1;
		if (s[l]!="jpg"){
			alert("請上傳jpg圖片！");
			frmUp.Pic1.focus();
			window.event.returnValue=false;
		}
	}else if (p1==""){
			alert("請上傳相片1！");
			frmUp.Pic1.focus();
			window.event.returnValue=false;
	}
}



function chkform_note(){
	if(form.no_theme.value==""){
		alert("請輸入主題");
		form.no_theme.focus();
		window.event.returnValue=false;
	}else if(form.no_txt.value==""){
		alert("請輸入內容");
		form.no_txt.focus();
		window.event.returnValue=false;		
	}
}



