﻿//mater.js, for the master page
 
        function clickIE() {if (document.all) {(message);return false;}}
        function clickNS(e) {if 
            (document.layers||(document.getElementById&&!document.all)) {
            if (e.which==2||e.which==3) {(message);return false;}}}
        if (document.layers) 
                    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
        else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
        document.oncontextmenu=new Function("return false")

        function btnAddImg_click() {
            document.getElementById('ctl00_cph_btnAddImg').disabled=true;
        }
        
        function btnSubmitNewVehicle_click() {
            document.getElementById('ctl00_cph_btnSubmitNewVehicle').disabled=true;
        }
        
        function ConfirmVDelete_click() {
            var rslt = confirm("WARNING: You are about to delete this vehicle from MTX Rides.  Once 'OK' is clicked there is no way of going back.\r\nClick 'Cancel' to exit.");
            return rslt;
        }
        
        function ConfirmVIDel_click() {
            var rslt = confirm("WARNING: You are about to remove a vehicle picture.  Once 'OK' is clicked this image will be permanently removed from this vehicle.\r\nClick 'Cancel' to exit.");
            return rslt;
        }
        
        function btnGo_onclick() {
        
            var vMk = document.getElementById('ctl00_ddlMake').value;
            var vMl = document.getElementById('ctl00_ddlModel').value;
            var vBr = document.getElementById('ctl00_ddlBrand').value;
            var vSR = document.getElementById('ctl00_ddlShowroom').value;
            var vPg = document.getElementById('ctl00_ddlSRID').value;
            
            window.location='Search.aspx?mk='+vMk+'&ml='+vMl+'&br='+vBr+'&sr='+vSR+'&pg='+vPg+'&sts=Search'
        }
        
        function Redirect_loc(sender) {
            window.location=sender;
        }
        
        function UpdateAcct_click() {
            var rslt = confirm("NOTE: If you are updating your email address, we will reset your password and email you a new password confirming your new email address.\r\nTo cancel this update, click 'Cancel'.");
            return rslt;
        }
        
        function ProveIt_mouseover() {
            document.getElementById("dProveIt").style.backgroundColor="#e56400";
        }
        function ProveIt_mouseout() {
            document.getElementById("dProveIt").style.backgroundColor="#1b1b1b";
        }
        
        function showDiv(sender) {
            if (document.getElementById) { // DOM3 = IE5, NS6
                document.getElementById(sender).style.display="block";
            }
            else {
                if (document.layers) { // Netscape 4
                eval('document.'+sender+'.visibility') = 'visible';
                }
                else { // IE 4
                eval('document.all.'+sender+'.style.visibility') = 'visible';
                }
            }
        }
        
        function hideDiv(sender) {
            if (document.getElementById) { // DOM3 = IE5, NS6
                document.getElementById(sender).style.display="none";
            }
            else {
                if (document.layers) { // Netscape 4
                eval('document.'+sender+'.visibility') = 'hidden';
                }
                else { // IE 4
                eval('document.all.'+sender+'.style.visibility') = 'hidden';
                }
            }
        }
        
        function setVideoInst(sender) {
            if (sender.value=='rbtnYouTube') {
                document.getElementById('dVid').innerHTML="Your You Tube link may look like this: http://www.youtube.com/v/DApvHpg7XCk or http://www.youtube.com/watch?v=DApvHpg7XCk <br />Your Video ID would be the 'DApvHpg7XCk'."
            } else if (sender.value=='rbtnGVideo') {
                document.getElementById('dVid').innerHTML="Your Google Video link may look like this: http://video.google.com/googleplayer.swf?docId=7442132073087725173&hl=en or http://video.google.com/videoplay?docid=7442132073087725173 <br />Your Video ID would be the '7442132073087725173'."
            }
        }

