function GetBrowsePhoto(channelId,startId,rows,cols,next){var url="/photo/browsephoto.aspx?channel="+channelId+"&startId="+startId+"&rows="+rows+"&cols="+cols+"&next="+next;AjaxCall(url,BrowsePhotoCallBack);return false;}function BrowsePhotoCallBack(){if(req.readyState==4){if(req.status==200){var rtext=req.responseText;div=document.getElementById("browsephoto");div.innerHTML=rtext;}}}function ss_getEmbed(domain,id,width){var height=Math.ceil(width*450/420)
var embed="<embed src="+domain+"/flvplayer/slideshow/"+id;embed=embed+" type=application/x-shockwave-flash quality=best width="+width+" height="+height+" wmode=transparent></embed>";return embed;}function ss_preview(domain,id,url){var embed=ss_getEmbed(domain,id,420);var url=url;var text=embed;var urltxt=document.getElementById("url");if(urltxt)urltxt.value=url;var embedtxt=document.getElementById("embed");if(embedtxt)embedtxt.value=embed;var pre=document.getElementById("preview");pre.innerHTML="<div align=left>"+text+"</div>";document.getElementById("curcryp").value=id;return false;}function ss_delele(id){if(confirm("Are you sure to delete the slideshow?")){document.getElementById("delcryp").value=id;return true;}else return false;}function ss_onWidthChange(domain,cid,idWidth,idEmbed){var width=document.getElementById(idWidth).value;if(isNaN(width)){alert("Only numbers are allowed");return;}else{var embedtxt=document.getElementById(idEmbed);embedtxt.style.backgroundColor="white";embedtxt.value=ss_getEmbed(domain,cid,width);embedtxt.style.backgroundColor='lightblue';setTimeout("ChangeColor('"+idEmbed+"')",150);}}function ChangeColor(id){var objToChange=document.getElementById(id);objToChange.style.backgroundColor="white";}function ss_setdefault(id){if(confirm('Are you sure to set this as your default slideshow?')){document.getElementById("curcryp").value=id;return true;}return false;}function photo_getuploadFilename(){var uploadframe=window.frames["UploadFrame"];if(uploadframe)strphoto=new String(window.frames["UploadFrame"].document.getElementById("media").value);else strphoto=new String(document.getElementById("media").value);var filename=strphoto.toLowerCase();return filename}function photo_upload(filename,allowExt){var bError=false;var uploadId=document.getElementById("UploadId");var strphoto="";var uploadframe=window.frames["UploadFrame"];if(filename.length>0){var ext=filename.substring(filename.lastIndexOf('.')+1);var extimage=new String(allowExt);if(extimage.indexOf(ext)<0){alert("The file you specified ["+filename+"] for your profile icon is not a valid image file. \n Valid files must have extension of "+extimage+". Please re-specify the image file.");document.getElementById("media").focus();bError=true;}if(!bError){var loadingDiv=document.getElementById("imgLoading");if(loadingDiv)loadingDiv.style.display="block";document.getElementById('newphoto').value=filename;if(!uploadframe){document.getElementById("btnSubmit").style.display="none";ShowDivById('divSaving');var aspnetForm=document.getElementById('aspnetForm');aspnetForm.method="post";aspnetForm.encoding="multipart/form-data";aspnetForm.action="?uploadid="+uploadId.value;aspnetForm.submit();}else{var uploadForm=uploadframe.document.getElementById("uploadForm");uploadForm.submit();photo_progressUpdate();}}}else{return true;}return false;}function photo_progressUpdate(){var uploadId=document.getElementById("UploadId");var a=window.location.protocol+"//"+window.location.host+"/upload/UploadProgress.ashx?f=txt&uploadId="+uploadId.value;AjaxCall(a,photo_uploadOnCallback);}var req,currentUploadStatus=0,isError=false;var STATUS_COMPLETE=2;function photo_uploadOnCallback(){var isError=false;if(req.readyState==4){currentUploadStatus=0;if(req.status==200){var tStatus=req.responseText;if(tStatus!=""){var status_values=tStatus.split(",");state=status_values[0];if(state!="ReceivingData"){switch(state){case"Error":isError=true;alert("Error uploading file.");break;case"ErrorMaxRequestLengthExceeded":alert("Error uploading file. Maximum request length exceeded.");isError=true;break;default:currentUploadStatus=STATUS_COMPLETE;break;}if(!isError){if(currentUploadStatus==STATUS_COMPLETE){window.setTimeout("document.getElementById('aspnetForm').submit();",1000);return;}}}}}if(!isError&&currentUploadStatus!=STATUS_COMPLETE)window.setTimeout("photo_progressUpdate()",1000);}}