<!--

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


handleSuccess = function(o){ if(o.responseText !== undefined){ div.innerHTML =  o.responseText ; } } ;
handleFailure = function(o){ if(o.responseText !== undefined){ div.innerHTML = "伺服器未能及時回應，請遲些再試。"; } } ;
callback = { success:handleSuccess, failure:handleFailure, argument: { foo:"foo", bar:"bar" } } ;
function makeRequest(sxUrl){ var request = YAHOO.util.Connect.asyncRequest('GET', sxUrl, callback); }



function viewmorecomment(ctype, cid, commentno, maxcomment, divid, oid, maketime)
{ $.ajax({ 	url: "/comment/viewmore.php", 
			type: "GET",
  			data: "ctype=" + ctype + "&cid=" + cid + "&commentno=" + commentno + "&maxcomment=" + maxcomment + "&divid=" + divid + "&oid=" + oid + "&maketime=" + maketime, 
     		success: function(data){ $('#' + divid + '_comment' ).html(data); 
			}
  		 });
}

function delcomment(ctype, cid, n, cmid)
{ div=document.getElementById("ck" + n);
  makeRequest('/comment/delcomment.php?ctype=' + ctype + '&cid=' + cid + '&cmid=' + cmid + '&ran=' + Math.floor(Math.random()*998+1));
  document.getElementById("ck" + n).style.visibility='hidden'; 
}




function changeSize(imgid)  //========================for info_photo
{ ih=document.getElementById(imgid).height ;
  iw=document.getElementById(imgid).width ;
  if (ih > iw)
  { ir=ih/iw;
    document.getElementById(imgid).width=60 ;	
	//document.getElementById(imgid).height=60 ;	
	it = Math.round((60 * ir)/2 -30) ;
    if (iw>60) 
    { tit = "-" + it + "px" ;  
    } else
	{ tit = it + "px" ;   	  
	}
    document.getElementById(imgid).top=tit ;	  
  } else
  { ir=iw/ih;
    document.getElementById(imgid).height=60 ;
	//document.getElementById(imgid).width=60 ;
	il= Math.round((60 * ir)/2 -30) ;	
    if (ih>60)
    { ir=iw/ih;
	  til = "-" + il + "px" ; 
    } else
	{ til = il + "px" ; 
	}  	   	
    document.getElementById(imgid).left=til ;

  }  
}

function resizei(imgid, maxs)
{ io = document.getElementById(imgid);
  ix = io.width;
  iy = io.height;
  if (ix!=0 && iy!=0) 
  { if (ix > iy) 
    { nr = maxs/iy;
      io.width=Math.round(ix * nr);
	  io.height=maxs;
	  sw=Math.round((io.width-maxs)/2);
	  sh=0;
    } else
    { nr = maxs/ix;
      io.width=maxs;
      io.height=Math.round(iy * nr);
	  sw=0;
	  sh=Math.round((io.height-maxs)/4);
    }
    io.style.marginLeft='-' + sw + 'px';
    io.style.marginTop ='-' + sh + 'px';    
  }
}

function showalltext(divid)
{ document.getElementById(divid + '_1').style.display='none';
  document.getElementById(divid + '_2').style.display='';
  document.getElementById(divid + '_3').style.display='none';
}


function donothing() {}

function deletecomment(ctype, cid, cmid, maketime, maxcomment, divid )
{ //$('#' + divid + '_message' ).html(divid);
  $.ajax({ 	url: "/comment/deletecomment.php", 
			type: "GET",
  			data: "ctype=" + ctype + "&cid=" + cid + "&cmid=" + cmid + "&maketime=" + maketime + "&maxcomment=" + maxcomment + "&divid=" + divid, 
     		success: function(data)
			{ $('#' + divid ).html(data);  
			  setTimeout("document.getElementById('" + divid + "_temp').style.display='none'; ", 2000);
		    }
  		 });
}

function postcomment(divid)
{ $.ajax({ 	url: "/comment/newcomment.php", 
     		type: "POST",
  			data: $('#' + divid + '_form').serialize(), 
     		success: function(data){ $('#' + divid ).html(data);  
									 setTimeout("document.getElementById('" + divid + "_temp').style.display='none'; ", 2000);
								    }
  		 });
}

function seticon(ctype, cid, maxcomment, divid, maketime, icon)
{ $.ajax({ 	url: "/comment/newicon.php", 
			type: "GET",
  			data: "ctype=" + ctype + "&cid=" + cid + "&maxcomment=" + maxcomment + "&divid=" + divid + "&maketime=" + maketime + "&icon=" + icon, 
     		success: function(data){ $('#' + divid ).html(data); 
									 setTimeout("document.getElementById('" + divid + "_temp').style.display='none'; ", 2000);
			}
  		 });
}




//-->