var isNS6=(navigator.userAgent.indexOf("Mozilla")>-1&&navigator.userAgent.indexOf("Gecko")>-1)?true:false;var isIE=(navigator.userAgent.indexOf("MSIE")>-1&&navigator.userAgent.indexOf("Opera")==-1)?true:false;var isOp=(navigator.userAgent.indexOf("Opera")>-1)?true:false;var CursorClass=new Array("default","pointer");function CleanTextBoxText(b,a){if(a.value==b){a.value=""}return true}document.observe("dom:loaded",function(){initOverLabels()});function initOverLabels(){if(!document.getElementById){return}var d,c,b;d=document.getElementsByTagName("label");for(var a=0;a<d.length;a++){if(d[a].className=="overlabel"){c=d[a].htmlFor||d[a].getAttribute("for");if(!c||!(b=document.getElementById(c))){continue}d[a].className="overlabel-apply";if(b.value!==""){hideLabel(b.getAttribute("id"),true)}b.onfocus=function(){hideLabel(this.getAttribute("id"),true)};b.onblur=function(){if(this.value===""){hideLabel(this.getAttribute("id"),false)}};d[a].onclick=function(){var f,e;f=this.getAttribute("for");if(f&&(e=document.getElementById(f))){e.focus()}}}}}SelectDeselectAll={initialize:function(){},ClickEvent:function(a){if(a.innerHTML=="Select All"){a.innerHTML="Deselect All";check=true}else{a.innerHTML="Select All";check=false}$$(".partner").each(function(b){b.checked=check});return false}};Event.addBehavior({".partnerOnly:click":function(a){a.stop();$("lnkSelectAll").innerHTML="Select All";$$(".partner").each(function(b){b.checked=false});this.previous().checked=true},"#CountryValue:change":function(a){a.stop();new Ajax.Request("/Ajax/VatRegisteredHandler.ashx",{parameters:{countryId:$F("CountryValue")},onSuccess:function(c){var b=c.responseText.evalJSON();if(b.isEUCountry){$("txtVatMemberState").setValue(b.memberState)}}})}});function hideLabel(d,b){var a;var e=document.getElementsByTagName("label");for(var c=0;c<e.length;c++){a=e[c].htmlFor||e[c].getAttribute("for");if(a==d){e[c].style.textIndent=(b)?"-9000px":"0px";return true}}}function showHideClip(a,b){document.getElementById(b).style.display="block";document.getElementById(a).style.display="none"}function ChangeQueryAndSubmit(b){var e=window.location.toString();var g="";var c="";e.match(/\?(.+)$/);var h=RegExp.$1;var h=h.split("&");var d="";for(var a=0;a<h.length;a++){var f=h[a].split("=");if(f[0]==b){d=f[1]}else{if(f[0]=="pn"){g="pn="+f[1];c="pn=1"}}}if(d!=""){e=window.location.toString().replace(b+"="+d,b+"="+document.getElementById(b)[document.getElementById(b).selectedIndex].value)}else{if(window.location.toString().indexOf("?")>0){e=window.location.toString()+"&"+b+"="+document.getElementById(b)[document.getElementById(b).selectedIndex].value}else{e=window.location.toString()+"?"+b+"="+document.getElementById(b)[document.getElementById(b).selectedIndex].value}}window.location.href=e.replace(g,c)}function ChangeSortByAndSubmit(b,g){var f=window.location.toString();var h="";var c="";f.match(/\?(.+)$/);var e=RegExp.$1;var e=e.split("&");var j="";for(var a=0;a<e.length;a++){var d=e[a].split("=");if(d[0]==b){j=d[1]}else{if(d[0]=="pn"){h="pn="+d[1];c="pn=1"}}}if(j!=""){f=window.location.toString().replace(b+"="+j,b+"="+g)}else{if(window.location.toString().indexOf("?")>0){f=window.location.toString()+"&"+b+"="+g}else{f=window.location.toString()+"?"+b+"="+g}}window.location.href=f.replace(h,c)}function EnableDatesInFilter(b,h,a,f,d){var g="";if(b!=null){g=b.id}var l=h!=null?h.id:"";var e=a!=null?a.id:"";var k=f!=null?f.id:"";var c=d.parentNode.parentNode.getElementsByTagName("*");for(var j=1;j<c.length;j++){if(c.item(j).tagName=="FIELDSET"||c.item(j).tagName=="DIV"||c.item(j).type=="radio"||c.item(j).tagName=="LABEL"||c.item(j).tagName=="P"||c.item(j).id==g||c.item(j).id==l||c.item(j).id==e||c.item(j).id==k){c.item(j).disabled=false}else{c.item(j).disabled=true}}}function checkSearch(){if(document.getElementById("howMany")&&!document.getElementById("howMany").disabled){return checknumber(document.getElementById("howMany").value)}return true}function checknumber(b){var c=false;var a=/(^\d+$)|(^\d+\.\d+$)/;if(a.test(b)){c=true}else{c=false}return(c)}Event.addBehavior({"#clipBins:click":function(a){a.stop();if(this.innerHTML=="Select All"){this.innerHTML="Deselect All";check=true}else{this.innerHTML="Select All";check=false}$$(".check").each(function(b){b.checked=check});ChangeButtonStatus();a.stop()},".check:click":function(a){ChangeButtonStatus()}});Event.observe(window,"load",function(){ChangeButtonStatus()});function numberChecked(){var b=0;var a=$$(".check");for(i=0;i<a.length;i++){if(a[i].checked){b++}}return b}function ChangeButtonStatus(){var c=numberChecked();var a=(c>0)?1:0;if(!IsUndefinedOrNull("clipBins")){var b=$$(".check");if(c==b.length){$("clipBins").innerHTML="Deselect All"}else{$("clipBins").innerHTML="Select All"}}if(!IsUndefinedOrNull("buyAllSelected")&&!IsUndefinedOrNull("deleteAllSelected")){$("buyAllSelected").src=buyAllImages[a];$("buyAllSelected").style.cursor=CursorClass[a];$("deleteAllSelected").src=deleteAllImages[a];$("deleteAllSelected").style.cursor=CursorClass[a]}else{if(!IsUndefinedOrNull("buyClipBin")){$("buyClipBin").src=buyClipBinImages[a];$("buyClipBin").style.cursor=CursorClass[a];if(!IsUndefinedOrNull("deleteClipBin")&&!IsUndefinedOrNull("shareClipBin")){$("deleteClipBin").src=deleteClipImages[a];$("deleteClipBin").style.cursor=CursorClass[a];$("shareClipBin").src=shareClipImages[a];$("shareClipBin").style.cursor=CursorClass[a]}else{if(!IsUndefinedOrNull("exitClipBin")){$("exitClipBin").src=exitClipBinImages[a];$("exitClipBin").style.cursor=CursorClass[a]}}}}}function IsUndefinedOrNull(a){if($(a)==undefined||$(a)==null){return true}else{return false}}function WriteFlashObjectToClipVideo(b,e){if(b.indexOf(".flv")>0){var c={};c.width="360";if(Boolean(e.toLowerCase()=="true")){c.height="203"}else{c.height="264"}c.buffer="6";c.autoplay="true";c.skin="/flash/clipplayerskin.swf";c.data=escape(b);var f={};f.allowFullScreen="true";f.wmode="transparent";f.id="mp3Player";f.name="";f.quality="high";swfobject.embedSWF("/flash/ClipPlayer.swf","VideoPath","360",Boolean(e.toLowerCase()=="true")?"239":"300","8.0.0","/script/expressInstall.swf",c,f)}else{var a=document.getElementById("VideoPath");var d=document.createElement("img");d.src="/i/nopreview_available.jpg";a.appendChild(d)}}function WriteFlashObjectToStockVideo(a,c){var b={};b.width="360";if(c){b.height="203"}else{b.height="264"}b.buffer="6";b.autoplay="true";b.skin="/flash/shotPlayerSkin.swf";b.src=escape(a);var d={};d.allowFullScreen="true";d.wmode="transparent";d.id="mp3Player";d.name="";d.quality="high";swfobject.embedSWF("/flash/ShotPlayer.swf","playerContainer","360",c?"239":"300","8.0.0","/script/expressInstall.swf",b,d)}function WriteFlashObjectToVideo(a,c,d,e){var b={};b.width=c;b.height=d;b.buffer="6";b.autoplay="true";b.skin="/flash/shotPlayerSkin.swf";b.src=escape(a);var f={};f.allowFullScreen="true";f.wmode="transparent";f.id="mp3Player";f.name="";f.quality="high";swfobject.embedSWF("/flash/ShotPlayer.swf",e,c,d+36,"8.0.0","/script/expressInstall.swf",b,f)}function UpdateShotInfo(k,j,n,b,c,f,m,d,a,e){try{var l=document.getElementById("InBasket"+b+j).innerHTML;var h=document.getElementById("InClipbin"+b+j).innerHTML;document.getElementById("shotPartNumber").innerHTML=k;document.getElementById("shotPartDuration").innerHTML=n;document.getElementById("shotPartRef").innerHTML=b+" "+j;document.getElementById("idShot").innerHTML=j;document.getElementById("SequenceNumber").innerHTML=k;document.getElementById("shotPartCopyright").innerHTML=c;if(e=="true"){document.getElementById("shotPartAddBasket").href="javascript:;";document.getElementById("shotPartAddClipbin").href="javascript:;";if(l=="true"){document.getElementById("shotPartAddBasket").style.display="none";document.getElementById("shotPartAddedBasket").style.display="block"}else{document.getElementById("shotPartAddBasket").style.display="block";document.getElementById("shotPartAddedBasket").style.display="none"}if(h=="true"){document.getElementById("shotPartAddClipbin").style.display="none";document.getElementById("shotPartAddedClipbin").style.display="block"}else{document.getElementById("shotPartAddClipbin").style.display="block";document.getElementById("shotPartAddedClipbin").style.display="none"}}else{document.getElementById("shotPartAddBasket").style.display="none";document.getElementById("shotPartAddedBasket").style.display="none";document.getElementById("shotPartAddClipbin").style.display="none";document.getElementById("shotPartAddedClipbin").style.display="none"}}catch(g){setTimeout("UpdateShotInfo('"+k+"','"+j+"','"+n+"','"+b+"','"+c+"','"+f+"','"+m+"','"+d+"','"+a+"','"+e+"')",20000)}}function WriteShotSWFObject(a,c,b){flashVars={};flashVars.width="360";if(b=="true"){flashVars.height="203"}else{flashVars.height="264"}flashVars.buffer="6";flashVars.autoplay="false";flashVars.src=a+".flv";flashVars.skin="/flash/shotPlayerSkin.swf";params={};params.allowFullScreen="true";params.wmode="transparent";params.id="shotPlayerId";params.name="shotPlayerId";params.quality="high";swfobject.embedSWF("/flash/ShotPlayer.swf",c,"360",(b=="true")?"239":"300","8.0.0","/script/expressInstall.swf",flashVars,params)}function HideThis(a){document.getElementById(a).style.display="none"}function ShowThisHideAll(a,b){for(i=0;i<b.length;i++){if(b[i]==a){document.getElementById(b[i]).style.display="block"}else{if(document.getElementById(b[i])!=undefined){document.getElementById(b[i]).style.display="none"}}}}function writeCookie(a,f,e,d){if(e){var c=new Date();c.setTime(c.getTime()+(e*24*60*60*1000));var b="; expires="+c.toGMTString()}if(!d){d="/"}else{var b=""}document.cookie=a+"="+f+b+"; path="+d}function readCookie(a){var f=a+"=";var b=document.cookie.split(";");for(var e=0;e<b.length;e++){var d=b[e];while(d.charAt(0)==" "){d=d.substring(1,d.length)}if(d.indexOf(f)==0){return d.substring(f.length,d.length)}}return null};