function GalleryImage(o,showStatus,moderator){var id=o.id;var desc=o.description;var ispublic=o.public;var url=o.url;var height=o.height;var width=o.width;var cssDimension=getCssDimension(165,110);var td='<table id="imgtbl_'+id+'" cellspacing="0" cellpadding="2" border="0" width="100%">'+'<tr>'+'<td>'+'<table cellspacing="2" cellpadding="0" border="0" width="100%">'+
(showStatus?'<tr>'+'<td valign="top" align="center">'+'<table cellspacing="0" cellpadding="0" border="0" style="padding-bottom:2px" width="100%">'+'<tr>'+'<td class="v10" width="33%">Status:</td>'+'<td class="v10" width="33%" align="center"><font color="'+(ispublic?'green">Public':'red">Private')+'</font></td>'+'<td width="33%" align="right" title="Show File Details">'+'<a href="member/FileDetailsHTML?id='+id+'" class="fakelink" onclick="return hs.htmlExpand(this, {slideshowGroup: \'group1\', objectType: \'ajax\', preserveContent: true} )">Details</a>'+'</td>'+'</tr>'+'</table>'+'</td>'+'</tr>':'')+'<tr>'+'<td valign="top" align="center" style="padding:2px;">'+'<div style="height:110px;width:165px;text-align:center;vertical-align:middle;">'+'<a href="'+url+'" class="highslide" onclick="return hs.expand(this)">'+'<img id="img_'+id+'" src="'+url+'?a='+(new Date()).getTime()+'" title="'+desc+'" style="'+cssDimension+'">'+'</a>'+'</div>'+'</td>'+'</tr>'+'</table>'+'</td>'+'</tr>'+
(showStatus?'<tr>'+'<td align="center">'+'<table cellspacing="2" cellpadding="0" border="0" style="margin-top:2px;">'+'<tr>'+
(moderator?'<td class="v10" valign="middle" align="center">'+'<input class="v10" type="checkbox" name="select_'+id+'">Select&nbsp;</td>':'')+'<td align="center">'+'<a href="javascript:counterclockwise('+id+');">'+'<img border="0" src="images/counter-rotate.gif" alt="Rotate Counter Clockwise">'+'</a>'+'</td>'+'<td align="center">'+'<a href="javascript:clockwise('+id+');">'+'<img border="0" src="images/rotate.gif" alt="Rotate Clockwise">'+'</a>'+'</td>'+
(moderator?'<td class="submitbtnnarrow" align="center" onclick="deleteFile('+id+')" title="Delete">Delete</td>':'')+'</tr>'+'</table>'+'</td>'+'</tr>':'')+'</table>';function getCssDimension(desiredWidth,desiredHeight){var dimension="";var ratio=(height/width);if(width>desiredWidth||height>desiredHeight){var imgheight=parseInt(desiredWidth*ratio);if(imgheight>desiredHeight){dimension="height:"+desiredHeight+"px;width:"+parseInt(desiredHeight/ratio)+"px;";}
else{dimension="width:"+desiredWidth+"px;height:"+imgheight+"px;";}}
else{return dimension="width:"+width+"px;height:"+height+"px;";}
return dimension;}
this.toString=function(){return td;}}
function deleteFile(id){if(!confirm("Are you sure you would like to delete file?")){return;}
window.status="Deleting File... Please Wait";var params=new Array();params[params.length]=new RequestParam("page","Gallery");params[params.length]=new RequestParam("id",id);callDeleteJSON(params,"moderator/DeleteFile",function(o,t,e){if(o!=null){if(e){alert(e);}
else{window.location=window.location.href;}}});}
function clockwise(id){rotateImage(id,"cw");}
function counterclockwise(id){rotateImage(id,"ccw");}
function rotateImage(id,rotate){var image=$("img_"+id);if(!image)return;var td=image.parentNode.parentNode.parentNode;td.innerHTML=createPictureFiller(165,100,"Rotating... Please Wait");var imgtbl=$('imgtbl_'+id);var moderator=imgtbl.rows[1].cells[0].getElementsByTagName('table')[0].rows[0].cells.length>2;var params=new Array();params[params.length]=new RequestParam("id",id);params[params.length]=new RequestParam("rotate",rotate);callGetJSON(params,"member/RotateImage",function(o,t,e){if(o!=null){if(e){alert(e);}
else{rotateImgObj=o;rotateModerator=moderator;rotateId=id;setTimeout('redrawImage()',4000);}}});}
var rotateModerator;var rotateId;var rotateImgObj;function redrawImage(){$('imgtbl_'+rotateId).parentNode.innerHTML=(new GalleryImage(rotateImgObj,true,rotateModerator)).toString()}