﻿// This function added to address MSIE's handling of embedded objects in the wake of the EOLAS '906 patent
//  by using a script to write the object into the document, rather than writing it directly (or "automatically").
// Usage:
//	in your document callthe flashFix() function with the following parameters:
//		flashSource		string		path and filename to .swf
//		imageSource		string		path and filename to an image that is loaded if the client does not have flash installed
//		width			int			the width of the flash/image in pixels
//		height			int			the height of the flash/image in pixels


function flashFix(flashSource, imageSource, width, height) {
	document.write('<object type="application/x-shockwave-flash" data="' + flashSource + '" width="' + width + '" height="' + height + '">');
	document.write('<param name="movie" value="' + flashSource + '" />');
	document.write('<param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="allowscriptaccess" value="always" /><param name="menu" value="false" />');
	document.write('<img src="' + imageSource + '" width="' + width + '" height="' + height + '" alt="image" />');
	document.write('</object>');
	}


//function dimOff()
//    {
//    document.getElementById("darkLayer").style.display = "none";
//    }
//function dimOn()
//    {
//    document.getElementById("darkLayer").style.display = "";
//    }

// This function disables right-click functionality

/*
var isNS = (navigator.appName == "Netscape") ? 1 : 0;
if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
function mischandler() {
	return false;
	}
function mousehandler(e) {
	var myevent = (isNS) ? e : event;
	var eventbutton = (isNS) ? myevent.which : myevent.button;
	if((eventbutton==2)||(eventbutton==3)) return false;
	}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
*/

function ToggleButton(button)
{  
    // If client validators not active   
    if (typeof(Page_Validators) == "undefined")   
    {        
        DisableButton(button.id);   
    } 
    // Force Page validation       
    if (typeof(Page_ClientValidate) == "function")    
    {                             
        Page_ClientValidate(button.validationGroup);                                   
        // If validation passed         
        if(Page_IsValid)         
        {              
            DisableButton(button.id)                
        }   
    }
    else   
    {        
        DisableButton(button.id);   
    }  

}      


function DisableButton(buttonID) 
{    
    window.document.getElementById(buttonID).disabled = true;
    window.document.getElementById(buttonID).value = "Processing...";
}        