function detectBrowser(){var d=document;var nav=navigator;this.agt=nav.userAgent.toLowerCase();this.major=parseInt(nav.appVersion);this.ns=(d.layers);this.dom=(d.getElementById)?1:0;this.ns4up=(this.ns&&this.major>=4);this.ns6=(this.agt.indexOf("Netscape6")!=-1);this.op=(window.opera?1:0);if(d.all)this.ie=1;else this.ie=0;this.ie4up=(this.ie&&this.major>=4);this.ie5=(d.all&&this.dom);this.gk=(typeof(nav.product)!="undefine"&&nav.product)?1:0;this.fb=(this.agt.indexOf("firebird")!=-1);this.fx=(this.agt.indexOf("firefox")!=-1);this.sf=(this.agt.indexOf("safari")!=-1);this.win=((this.agt.indexOf("win")!=-1)||(this.agt.indexOf("16bit")!=-1));this.mac=(this.agt.indexOf("mac")!=-1);}var gBW=new detectBrowser();function getReqXMLHTTPObj(){var a=null;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){a=null;}}if(!a&&typeof XMLHttpRequest!="undefined"){a=new XMLHttpRequest();}return a;}function getCurrentRoot(){var pos=window.location.pathname.lastIndexOf("/");return window.location.protocol+"//"+window.location.host+window.location.pathname.substr(0,pos)+"/";}var req;function AjaxCall(url,onCallback){req=getReqXMLHTTPObj();req.onreadystatechange=onCallback;var rnd=Math.floor(Math.random()*100000)
url=url+"&rnd="+rnd;req.open("GET",url,true);req.send(null);}function AjaxCallNoCallBack(url){req=getReqXMLHTTPObj();req.open("GET",url,false);req.send(null);}function AjaxPostCall(url,qs,onCallback){req=getReqXMLHTTPObj();if(onCallback)req.onreadystatechange=onCallback;var rnd=Math.floor(Math.random()*100000);qs=qs+"&rnd="+rnd+"&method=post";req.open("POST",url,true);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");req.setRequestHeader("Accept","text/xml");req.send(qs);}function ShowPlayerRegular(url){document.write("<embed src=");document.write(url);document.write(" type=application/x-shockwave-flash quality=high WIDTH=445 HEIGHT=369 wmode=transparent></embed>");}function ShowPlayer(url){document.write("<embed src=");document.write(url);document.write(" type=application/x-shockwave-flash quality=high WIDTH=350 HEIGHT=266  wmode=transparent></embed>");}function copyit(tempval){tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")}var voteDivId;function RatePhoto(pId,curRate,divId,live){voteDivId=divId;var ratingDiv=document.getElementById(voteDivId);ratingDiv.innerHTML='<table align=center border=0 cellpadding=10 cellspacing=0><tr><td align=center valign=middle><img src=/images/misc/loading.gif></td></tr></table>';var url="/photo/addRating.ashx";var qs="pid="+pId+"&l="+live+"&cr="+curRate;AjaxPostCall(url,qs,updatephotovote);}function updatephotovote(){if(req.readyState==4){updateAjaxControl(voteDivId,'Rating Error.<br>Please try again later.');}}function voteMedia(crypId,mediaid,rate,divid,curRate){voteDivId=divid;var d=document.getElementById(voteDivId);var url="/media/rateMedia.ashx";var qs="c="+crypId+"&m="+mediaid+"&r="+rate+"&cr="+curRate;AjaxPostCall(url,qs,updatevote);var buttons=document.getElementById('b'+divid);if(buttons!=null)buttons.innerHTML='<b>Thank You!</b>';return false;}function updatevote(){if(req.readyState==4){if(req.status==200){var rtext=req.responseText;if(rtext!="-1"){var d=document.getElementById(voteDivId);d.innerHTML=rtext;}else{var d=document.getElementById('b'+voteDivId);if(d!=null)d.innerHTML="<b>Already Voted!</b>";else alert("You've already voted for this video.");}}}}function cantvoteownvideo(){var msg='<b>You cannot vote your own videos.</b>';return popup(window.event,msg);}function alreadyvote(){var msg="<b>You've already voted for this video.</b>";return popup(window.event,msg);}function loginToVote(evt){var msg='<img src=/images/buttons/btn_thumbsup.gif align=absmiddle>&nbsp;&nbsp;<strong>Make your vote count!</strong><br>To vote videos, <a href="/userlogin.aspx">login</a> or <a href="/newuser.aspx">join LiveVideo</a> for free.';return popup(evt,msg);}function OpenEmailVideo(url){window.location=url;}function unpopup(){var popEle=document.getElementById('pop');popEle.style.visibility="hidden";}function popup(evt,text){unpopup();var popEle=document.getElementById('pop');popEle.innerHTML='<div id="poppDiv" style="text-align:center;background-color:#F5F5F5""><br>'+text+'<br><br><a href="javascript:unpopup()" >Close</a><br><br></div>';popEle.style.zIndex=10000;popEle.style.visibility="visible";if(!evt)evt=window.event;if(evt){var target=evt.target?evt.target:evt.srcElement;if(target.nodeType==3)target=target.parentNode;var offsets=GetOffsets(target);popEle.style.left=offsets.x+"px";popEle.style.top=offsets.y-80+"px";}else{popEle.style.left=screen.availWidth/2+"px";popEle.style.top=screen.availHeight/2+"px";}popEle.innerHTML='<div id="poppDiv" style="text-align:center;background-color:#F5F5F5"><br>'+text+'<br><br><a href="javascript:unpopup()" >Close</a><br><br></div>';popEle.style.zIndex=10000;popEle.style.visibility="visible";return false;}function showmap(source){document.write(' <div id="flash" style="position:absolute; z-index:0;">');document.write(' <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="893" height="663" id="map" align="middle">');document.write(' <param name="allowScriptAccess" value="sameDomain" />');document.write(' <param name="wmode" value="transparent" />');document.write(' <param name="movie" value="');document.write(source);document.write('" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />');document.write(' <embed src="');document.write(source);document.write('" quality="high" bgcolor="#ffffff" width="893" height="663" name="map" wmode="transparent" ');document.write(' align="middle" allowScriptAccess="sameDomain" ');document.write(' type="application/x-shockwave-flash" ');document.write(' pluginspage="http://www.macromedia.com/go/getflashplayer" />');document.write(' </object>');document.write(' </div>');}function checkAll(formname,checked){var form=document.forms[formname];for(var i=0;i<form.elements.length;i++){var e=form.elements[i];if(e.type=='checkbox'){e.checked=checked;}}}function defaultButton(btName,evt){var btn=document.getElementById(btName);if(btn!=null){if(evt.keyCode==13){evt.returnValue=false;evt.cancel=true;btn.click();}}}function ShowPlayerSmall(url){document.write("<embed src=");document.write(url);document.write(" type=application/x-shockwave-flash quality=high WIDTH=100 HEIGHT=75 wmode=transparent></embed>");}function ShowPlayerSized(url,playerWidth,playerHeight){document.write("<embed src=");document.write(url);document.write(" type=application/x-shockwave-flash quality=high WIDTH=");document.write(playerWidth);document.write(" HEIGHT=");document.write(playerHeight);document.write(" wmode=transparent></embed>");}function togDisp(evt){stopB(evt);var elems=document.getElementsByName('more');var target=evt.target?evt.target:evt.srcElement;if(target.nodeType==3)target=target.parentNode;var offsets=GetOffsets(target);for(var i=0;i<elems.length;i++){var obj=elems[i],dp="";if(obj.style.display==""){dp="none";}obj.style.display=dp;obj.style.top=obj.style.top+135+"px";obj.style.left=offsets.x+-11+"px";}return false;}function stopB(e){if(!e)e=window.event;e.cancelBubble=true;}function ShowSWF(url,w,h){document.write("<embed src=");document.write(url);document.write(" type=application/x-shockwave-flash quality=high WIDTH=\"");document.write(w);document.write("\" HEIGHT=\"");document.write(h);document.write("\" wmode=transparent></embed>");}function AlertDiv(evt,divhtml){var msg=document.getElementById(divhtml).innerHTML;var popEle=document.getElementById('pop');if(popEle){popEle.innerHTML='<div id="poppDiv">'+msg+'<br></div>';popEle.style.zIndex=1000;popEle.style.visibility="visible";popEle.style.width=10;var target=evt.target?evt.target:evt.srcElement;if(target.nodeType==3)target=target.parentNode;var offsets=GetOffsets(target);popEle.style.left=offsets.x+"px";popEle.style.top=offsets.y+15+"px";}return false;}function CheckCharCount(inputId,displayId,maxCount,bTruncate){var inputEle=document.getElementById(inputId);var displayEle=document.getElementById(displayId);var charsLeft=maxCount-inputEle.value.length;if(charsLeft>0){displayEle.innerHTML='<b>'+charsLeft+'</b>';}else{if(bTruncate==1){inputEle.value=inputEle.value.substr(0,maxCount);charsLeft=0;}displayEle.innerHTML='<font color=red><b>'+charsLeft+'</b></font>';}}