﻿var MovieTimeUpdateInterval=0;var isVideoPlaying=false;var isVideoPaused=false;var CurrentBandWidth= -1;var BandWidthChangeRequest=false;var MovieMMSVideoURISetIndex=0;var LadyDogPictureSetIndex=0;var MovieMMSVideoURISet=new Array(2);MovieMMSVideoURISet[0]="mms://Blade.Balmydaze.com/LadyMyLove/LadyMyLoveDVD.wmv";MovieMMSVideoURISet[1]="mms://Blade.Balmydaze.com/LadyMyLove/LadyMyLoveStills.wmv";var LadyPICS=new Array(5);LadyPICS[0]="./Images/LadyThePuppy 1.jpg";LadyPICS[1]="./Images/LadyThePuppy 2.jpg";LadyPICS[2]="./Images/LadyThePuppy 3.jpg";LadyPICS[3]="./Images/LadyThePuppy 4.jpg";LadyPICS[4]="./Images/LadyThePuppy 5.jpg";(function(){var swapper=function(suffleMe,el,all){var ran=Math.floor(Math.random()*all);var saver=suffleMe[el];suffleMe[el]=suffleMe[ran];suffleMe[ran]=saver;};Array.prototype.shuffle=function(){var i=this.length;var Total=i;while(i--){swapper(this,i,Total);}};})();function enableMostButtons(){try{var TheButton=document.getElementById("rewindButton");if(TheButton!=null){TheButton.disabled=false;TheButton.style.backgroundColor="#440000";}TheButton=document.getElementById("fastforwardButton");if(TheButton!=null){TheButton.disabled=false;TheButton.style.backgroundColor="#440000";}TheButton=document.getElementById("stopButton");if(TheButton!=null){TheButton.disabled=false;TheButton.style.backgroundColor="#440000";}TheButton=document.getElementById("pauseButton");if(TheButton!=null){TheButton.disabled=false;TheButton.style.backgroundColor="#440000";}TheButton=document.getElementById("nextfilmButton");if(TheButton!=null){TheButton.disabled=false;TheButton.style.backgroundColor="#440000";}}catch(e){writeDebug("Error in enableMostButtons ["+e.name+"]: "+e.message,true);}};function disableMostButtons(){try{var TheButton=document.getElementById("rewindButton");if(TheButton!=null){TheButton.disabled=true;TheButton.style.backgroundColor="#664444";}TheButton=document.getElementById("fastforwardButton");if(TheButton!=null){TheButton.disabled=true;TheButton.style.backgroundColor="#664444";}TheButton=document.getElementById("stopButton");if(TheButton!=null){TheButton.disabled=true;TheButton.style.backgroundColor="#664444";}TheButton=document.getElementById("pauseButton");if(TheButton!=null){TheButton.disabled=true;TheButton.style.backgroundColor="#664444";}TheButton=document.getElementById("nextfilmButton");if(TheButton!=null){TheButton.disabled=true;TheButton.style.backgroundColor="#664444";}}catch(e){writeDebug("Error in disableMostButtons ["+e.name+"]: "+e.message,true);}};function mainButtonSetMouseOver(button){try{if(button!=null){if(button.id!=null){var curButton=document.getElementById(button.id);curButton.style.color="#ffffff";curButton.style.backgroundColor="#aa0000";curButton.style.fontWeight="Bold";}}}catch(e){writeDebug("Error in mainButtonSetMouseOver ["+e.name+"]: "+e.message,true);}};function mainButtonSetMouseDown(button){try{if(button!=null){if(button.id!=null){var curButton=document.getElementById(button.id);curButton.style.color="#ffffff";curButton.style.backgroundColor="#000000";curButton.style.fontWeight="Bold";}}}catch(e){writeDebug("Error in mainButtonSetMouseDown ["+e.name+"]: "+e.message,true);}};function mainButtonSetMouseOut(button){try{if(button!=null){if(button.id!=null){var curButton=document.getElementById(button.id);curButton.style.color="#ffffff";curButton.style.backgroundColor="#440000";curButton.style.fontWeight="Normal";}}}catch(e){writeDebug("Error in mainButtonSetMouseOut ["+e.name+"]: "+e.message,true);}};function PleasePlayTheMovie(){try{var TheButton=document.getElementById("nextfilmButton");if(TheButton!=null){TheButton.disabled=true;TheButton.style.backgroundColor="#664444";}var thePLAYER=document.getElementById("VideoZap");if(!isVideoPlaying&& !isVideoPaused){thePLAYER.controls.stop();thePLAYER.URL=MovieMMSVideoURISet[0];}thePLAYER.controls.play();isVideoPlaying=true;isVideoPaused=false;return false;}catch(e){writeDebug("Error in PleasePlayTheMovie ["+e.name+"]: "+e.message,true);}};function PleaseFastReverseTheMovie(){try{if(isVideoPlaying||isVideoPaused){var thePLAYER=document.getElementById("VideoZap");if(thePLAYER.controls.isAvailable('FastReverse')){if(thePLAYER.settings.rate==1){thePLAYER.controls.fastReverse();}else if(thePLAYER.settings.rate== -5){thePLAYER.settings.rate== -10;}}}return false;}catch(e){writeDebug("Error in PleaseRewindTheMovie ["+e.name+"]: "+e.message,true);}};function PleaseFastForwardTheMovie(){try{if(isVideoPlaying||isVideoPaused){var thePLAYER=document.getElementById("VideoZap");if(thePLAYER.controls.isAvailable('FastForward')){if(thePLAYER.settings.rate==1){thePLAYER.controls.fastForward();}else if(thePLAYER.settings.rate==5){thePLAYER.settings.rate==10;}}}}catch(e){writeDebug("Error in PleaseFastForwardTheMovie ["+e.name+"]: "+e.message,true);}};function PleasePauseTheMovie(){try{if(isVideoPlaying||isVideoPaused){var thePLAYER=document.getElementById("VideoZap");thePLAYER.controls.pause();isVideoPlaying=false;isVideoPaused=true;}}catch(e){writeDebug("Error in PleasePauseTheMovie ["+e.name+"]: "+e.message,true);}};function NextMoviePlease(){try{var thePLAYER=document.getElementById("VideoZap");if(isVideoPlaying||isVideoPaused){TheMovieTimeDIV=document.getElementById("theMovieTime");if(TheMovieTimeDIV!=null){TheMovieTimeDIV.innerHTML="";}thePLAYER.controls.stop();window.A_SLIDERS[0].f_setValue(0,1);isVideoPlaying=false;isVideoPaused=false;thePLAYER.controls.play();}LadyDogPictureSetIndex++;if(LadyDogPictureSetIndex>LadyPICS.length-1){LadyDogPictureSetIndex=0;}thePLAYER.URL=LadyPICS[LadyDogPictureSetIndex];thePLAYER.controls.play();}catch(e){writeDebug("Error in NextMoviePlease ["+e.name+"]: "+e.message,true);}};function PleaseStopTheMovie(){try{var TheButton=document.getElementById("nextfilmButton");if(TheButton!=null){TheButton.disabled=false;TheButton.style.backgroundColor="#440000";}var thePLAYER=document.getElementById("VideoZap");TheMovieTimeDIV=document.getElementById("theMovieTime");if(TheMovieTimeDIV!=null){TheMovieTimeDIV.innerHTML="";}if(isVideoPlaying||isVideoPaused){thePLAYER.controls.stop();LadyDogPictureSetIndex++;if(LadyDogPictureSetIndex>LadyPICS.length-1){LadyDogPictureSetIndex=0;}thePLAYER.URL=LadyPICS[LadyDogPictureSetIndex];thePLAYER.controls.play();}window.A_SLIDERS[0].f_setValue(0,1);isVideoPlaying=false;isVideoPaused=false;if(BandWidthChangeRequest){BandWidthChangeRequest=false;TheBandWidthMsgDIV=document.getElementById("BandWidthMessage");if(TheBandWidthMsgDIV!=null){TheBandWidthMsgDIV.innerHTML="";}try{thePLAYER=document.getElementById("VideoZap");thePLAYER.close();thePLAYER.network.maxBandwidth=CurrentBandWidth;}catch(e){writeDebug("Trouble in PleaseStopTheMovie()... could not set maxBandwidth! ["+e.name+"]: "+e.message,true);}}}catch(e){writeDebug("Error in PleaseStopTheMovie ["+e.name+"]: "+e.message,true);}};function SetNewMaxBandwidth(){try{var thisForm=document.forms[0];if(thisForm!=null){for(i=0;i<thisForm.clampmaxbandwidth.length;i++){if(thisForm.clampmaxbandwidth[i].checked){break;}}if(thisForm.clampmaxbandwidth[i].value!=CurrentBandWidth){CurrentBandWidth=thisForm.clampmaxbandwidth[i].value;BandWidthChangeRequest=true;setCookie("BandWidth",CurrentBandWidth,100);TheBandWidthMsgDIV=document.getElementById("BandWidthMessage");if(TheBandWidthMsgDIV!=null){TheBandWidthMsgDIV.style.display="block";TheBandWidthMsgDIV.style.visibility="visible";TheBandWidthMsgDIV.style.color="#0000ff";TheBandWidthMsgDIV.style.fontSize="18";TheBandWidthMsgDIV.style.fontWeight="Bold";TheBandWidthMsgDIV.innerHTML="Please Stop the Video Player to change the Bandwidth";}}}}catch(e){writeDebug("Error in SetNewMaxBandwidth ["+e.name+"]: "+e.message,true);}};function scrubberMouseMove(){try{var thePLAYER=document.getElementById("VideoZap");if(thePLAYER!=null){if(thePLAYER.playState==3||thePLAYER.playState==4||thePLAYER.playState==5||thePLAYER.playState==6){var currentScrubberValue=document.getElementById('sliderValue1').value;var scrubberTime=thePLAYER.currentMedia.duration*(currentScrubberValue/100);var scrubSecs=Math.ceil(scrubberTime);var scrubMins=0;var scrubHours=0;if(scrubSecs>=60){scrubMins=parseInt(scrubSecs/60);scrubSecs-=(parseInt(scrubMins*60));if(scrubMins>=60){scrubHours=parseInt(scrubMins/60);scrubMins-=(parseInt(scrubHours*60));}}var timeString;if(scrubHours==0){timeString="";}else if(scrubHours<10){timeString="0"+scrubHours.toString()+":";}else{timeString=scrubHours.toString()+":";}if(scrubMins<10){timeString+="0"+scrubMins.toString()+":";}else{timeString+=scrubMins.toString()+":";}if(scrubSecs<10){timeString+="0"+scrubSecs.toString();}else{timeString+=scrubSecs.toString();}TheMovieTimeDIV=document.getElementById("theMovieTime");if(TheMovieTimeDIV!=null){if(thePLAYER.controls.currentPositionString!=""){TheMovieTimeDIV.innerHTML=timeString;TheMovieTimeDIV.innerHTML+="/";TheMovieTimeDIV.innerHTML+=thePLAYER.currentMedia.durationString;}}}}}catch(e){writeDebug("ERROR in scrubberMouseMove() ["+e.name+"]: "+e.message,true);}};function scrubberMouseUp(){try{var thePLAYER=document.getElementById("VideoZap");if(thePLAYER!=null){if(thePLAYER.playState==3||thePLAYER.playState==4||thePLAYER.playState==5||thePLAYER.playState==6){var currentScrubberValue=document.getElementById('sliderValue1').value;var scrubberTime=thePLAYER.currentMedia.duration*(currentScrubberValue/100);thePLAYER.controls.currentPosition=Math.ceil(scrubberTime);}}}catch(e){writeDebug("ERROR in scrubberMouseUp() ["+e.name+"]: "+e.message,true);}};function DoTimerPOP(){try{MovieTimeUpdateInterval++;if(MovieTimeUpdateInterval>=2){MovieTimeUpdateInterval=0;if(window.n_activeSliderId==null){var thePLAYER=document.getElementById("VideoZap");if(thePLAYER!=null){if(thePLAYER.playState==3||thePLAYER.playState==4||thePLAYER.playState==5||thePLAYER.playState==6){TheMovieTimeDIV=document.getElementById("theMovieTime");if(TheMovieTimeDIV!=null){if(thePLAYER.controls.currentPositionString!=""){TheMovieTimeDIV.innerHTML=thePLAYER.controls.currentPositionString;TheMovieTimeDIV.innerHTML+="/";TheMovieTimeDIV.innerHTML+=thePLAYER.currentMedia.durationString;}}var timeDiff=thePLAYER.controls.currentPosition/thePLAYER.currentMedia.duration;window.A_SLIDERS[0].f_setValue(timeDiffpercent=timeDiff*100,1);}}}}}catch(e){writeDebug("ERROR in DoTimerPOP() Setting the Movie Time: ["+e.name+"]: "+e.message,true);}window.setTimeout('DoTimerPOP()',100);};function load(){clearDebug();var TheScrubberInput=document.getElementById("sliderValue1");if(TheScrubberInput!=null){TheScrubberInput.style.display="none";TheScrubberInput.style.visibility="hidden";}try{var cookieBandWidth=getCookie("BandWidth");if(cookieBandWidth!=null){var OldCheck= -1;var NewCheck= -1;var thisForm=document.forms[0];if(thisForm!=null){for(i=0;i<thisForm.clampmaxbandwidth.length;i++){if(thisForm.clampmaxbandwidth[i].checked){OldCheck=i;}if(thisForm.clampmaxbandwidth[i].value==cookieBandWidth){NewCheck=i;}}if(OldCheck!= -1&&NewCheck!= -1){thisForm.clampmaxbandwidth[OldCheck].checked=false;thisForm.clampmaxbandwidth[NewCheck].checked=true;}}}else{cookieBandWidth=350000;}try{var thePLAYER=document.getElementById("VideoZap");thePLAYER.close();thePLAYER.network.maxBandwidth=cookieBandWidth;thePLAYER.URL=LadyPICS[0];thePLAYER.controls.play();}catch(e){writeDebug("Trouble in load(cookieBandWidth)... could not set maxBandwidth!",true);}}catch(e){writeDebug("Error in load(cookieBandWidth) ["+e.name+"]: "+e.message,true);}DoTimerPOP();};var debugDiv=null;var debugSpan=null;var debugShow=false;function toggleDebugView(){try{if(debugShow){debugShow=false;hideDebug();}else{debugShow=true;showDebug();}}catch(e){alert("toggleDebugView() call failed");}};function showDebug(){try{debugDiv=document.getElementById("debugDivContent");if(debugDiv!=null){debugDiv.style.display="block";debugDiv.style.visibility="visible";}}catch(e){alert("showDebug() call failed");}};function hideDebug(){try{debugDiv=document.getElementById("debugDivContent");if(debugDiv!=null){debugDiv.style.display="none";debugDiv.style.visibility="hidden";}}catch(e){alert("hideDebug() call failed");}};function clearDebug(){try{debugDiv=document.getElementById("debugDivContent");if(debugDiv!=null){debugDiv.innerHTML="";writeClearLink();}debugSpan=document.getElementById("debugSpanContent");if(debugSpan!=null){debugSpan.style.color="#009900";}}catch(e){alert("clearDebug() call failed");}};function writeDebug(MessageOut,AddTime){try{if(AddTime==null||AddTime==""){AddTime=false;}debugDiv=document.getElementById("debugDivContent");if(debugDiv!=null){if(AddTime){debugDiv.innerHTML+=Date()+"<br\/>"+MessageOut+"<br\/>";}else{debugDiv.innerHTML+=MessageOut+"<br\/>";}}debugSpan=document.getElementById("debugSpanContent");if(debugSpan!=null&&debugSpan.style.color!="#990000"){debugSpan.style.color="#990000";}}catch(e){alert("writeDebug() call failed");}};function writeEval(code){writeDebug(code+" = "+eval(code),true);};function writeDebugObject(myobject){var strCollection="";for(curObj in myobject){if(typeof myobject[curObj]=="object"){strCollection+=curObj+": "+myobject[curObj]+"<br\/>";}else{try{strCollection+=curObj+": "+myobject[curObj]+"<br\/>";}catch(e){strCollection+=curObj+": Unable to evaluate!<br\/>";}}}writeDebug(strCollection,false);};function writeClearLink(){writeDebug("<a href='#' title='Cleanup this mess!' onclick='clearDebug(); return false;'>Clear the Debug Window!</a>",false);};function dumpToPopup(x){var win=window.open();for(var i in x){try{win.document.write(i+" = "+x[i]+"<br>");}catch(e){win.document.write(i+": Unable to evaluate!<br>");}}}
