var _mx_movieUrl	= "";
var _mx_width		= "1024";
var _mx_height		= "768";
var _mx_id			= "mx_";
var _mx_color		= "#ffffff";
var _mx_params		= "";
var _mx_sessionId	= "";


function MxSetProperties( flash_movieUrl, flash_width, flash_height, flash_id, flash_color, flash_params, sessionId ){
	_mx_movieUrl	= flash_movieUrl;
	_mx_width		= flash_width;
	_mx_height		= flash_height;
	_mx_id			= flash_id;
	_mx_color		= flash_color;
	_mx_params		= flash_params;
	_mx_sessionId	= sessionId;
}

function MxGetObject(){
	var isInternetExplorer	= navigator.appName.indexOf("Microsoft") != -1;
	var mxObj				= isInternetExplorer ? eval( "document.all." + _mx_id ) : eval( "document." + _mx_id ); //document.getElementById( _mx_id );
	
	return mxObj;
}

function MxGetObjectById( objectId ){
	var isInternetExplorer	= navigator.appName.indexOf("Microsoft") != -1;
	var mxObj				= isInternetExplorer ? eval( "document.all." + objectId ) : eval( "document." + objectId );
	
	return mxObj;
}

function MxSetContent(  ){
	MxSetContentProp( _mx_movieUrl, _mx_width, _mx_height, _mx_id, _mx_color, _mx_params, _mx_sessionId );
}
	
function MxSetContentProp( flash_movieUrl, flash_width, flash_height, flash_id, flash_color, flash_params, flash_sessionId ){
	flash_params	+= flash_params=="" ?  ("?SessionId=" + flash_sessionId + "&MovieId=" + flash_id ) : ( "&SessionId=" + flash_sessionId  + "&MovieId=" + flash_id );
		
	document.writeln( "<!-- saved from url=(0013)about:internet -->" );
	document.writeln( "<object " );
	document.writeln( "classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" " );
	document.write( "codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" " );
	document.write( "width=\"" + flash_width + "\" " );
	document.write( "height=\"" + flash_height + "\" " );
	document.write( "id=\"" + flash_id + "\" " ); 
	document.write( "align=\"middle\" " );
	document.write( ">" );
	document.write( "<param name=\"allowScriptAccess\" value=\"sameDomain\" /> " );
	document.write( "<param name=\"movie\" value=\"" + flash_movieUrl + flash_params + "\" /> " );
	document.write( "<param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"" + flash_color + "\" /> " );
	document.write( "<embed src=\"" + flash_movieUrl + "\" quality=\"high\" bgcolor=\"#ffffff\" width=\"" + flash_width + "\" height=\"" + flash_height + "\" name=\"" + flash_id + "\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /> " );
	document.writeln( "</object> " );
}


function MxSetContentProp2( flash_movieUrl, flash_width, flash_height, obj_width, obj_height, flash_id, flash_color, flash_params, flash_sessionId ){
	flash_params	+= flash_params=="" ?  ("?SessionId=" + flash_sessionId + "&MovieId=" + flash_id ) : ( "&SessionId=" + flash_sessionId  + "&MovieId=" + flash_id );
		
	document.writeln( "<!-- saved from url=(0013)about:internet -->" );
	document.writeln( "<object " );
	document.writeln( "classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" " );
	document.write( "codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" " );
	document.write( "width=\"" + obj_width + "\" " );
	document.write( "height=\"" + obj_height + "\" " );
	document.write( "id=\"" + flash_id + "\" " ); 
	document.write( "align=\"middle\" " );
	document.write( ">" );
	document.write( "<param name=\"allowScriptAccess\" value=\"sameDomain\" /> " );
	document.write( "<param name=\"movie\" value=\"" + flash_movieUrl + flash_params + "\" /> " );
	document.write( "<param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"" + flash_color + "\" /> " );
	document.write( "<embed src=\"" + flash_movieUrl + "\" quality=\"high\" bgcolor=\"#ffffff\" width=\"" + flash_width + "\" height=\"" + flash_height + "\" name=\"" + flash_id + "\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /> " );
	document.writeln( "</object> " );
}

function GetMxSetContentProp2( flash_movieUrl, flash_width, flash_height, obj_width, obj_height, flash_id, flash_color, flash_params, flash_sessionId ){
    var content = "";
	flash_params	+= flash_params=="" ?  ("?SessionId=" + flash_sessionId + "&MovieId=" + flash_id ) : ( "&SessionId=" + flash_sessionId  + "&MovieId=" + flash_id );
		
	content += ( "<!-- saved from url=(0013)about:internet -->\n" );
	content +=( "<object \n" );
	content +=( "classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" \n" );
	content +=( "codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" " );
	content +=( "width=\"" + obj_width + "\" " );
	content +=( "height=\"" + obj_height + "\" " );
	content +=( "id=\"" + flash_id + "\" " ); 
	content +=( "align=\"middle\" " );
	content +=( ">" );
	content +=( "<param name=\"allowScriptAccess\" value=\"sameDomain\" /> " );
	content +=( "<param name=\"movie\" value=\"" + flash_movieUrl + flash_params + "\" /> " );
	content +=( "<param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"" + flash_color + "\" /> " );
	content +=( "<embed src=\"" + flash_movieUrl + "\" quality=\"high\" bgcolor=\"#ffffff\" width=\"" + flash_width + "\" height=\"" + flash_height + "\" name=\"" + flash_id + "\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /> " );
	content +=( "</object> \n" );
	
	
	return content;
}



// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --]

function MxResizeWidth( newWidth ){
	var resizeObj	= MxGetObject();	
	resizeObj.width = newWidth;
}

function MxResizeHeight( newHeight ){
	var resizeObj	= MxGetObject();	
	resizeObj.height = newHeight;
}

function MxResizeHeightById( newHeight, objectId ){
//alert("newHeight: " + newHeight +", objectId: " + objectId );
	var resizeObj	= MxGetObjectById( objectId );	
	resizeObj.height = newHeight;
}

function MxConfirm( message ){
	return confirm( message );
}

function MxAlert( message ){
	alert( message );
}


function MxCloseDialog(){					
	window.returnValue	= new Object();
	window.close();
	return false;
}

function MxCloseWindow(){	
	window.close();
}

function MxPopUp( webUri, windowName, width, height, resizeble, scrollable ){	
    if( scrollable==null ) scrollable = 1;
    
	var xloc=(window.screen.availWidth-width)/2; 
	var yloc=(window.screen.availHeight-height)/2; 
	
	window.open( webUri , windowName, "height="+height+", width="+width+", top="+yloc+", left="+xloc+", scrollbars=" + ( scrollable ? 1 : 0 ) + ", menubar=0, location=0, resizable=" + (resizeble ? 1 : 0 ) + ", status=0");

}

function MxDoScroll( delta ){	
	//window.status	= "Delta: " + delta;		 
	window.scrollBy( 0, delta<0 ? 50 : -50 );
}

function MxResetPageScroll(  ){		
	window.scroll( 0, 0 );
}


function MxStatus( message ){
	window.status	= message;
}





function MxSetBGColor( color ){
    var mxObj	= MxGetObject();	    
	document.body.style.backgroundColor = color;
	mxObj.style.backgroundColor = document.body.style.backgroundColor;
	mxObj.bgColor               = mxObj.style.backgroundColor;	
}



function MxReload( ){
	document.location.reload(true);
}

function MxReActiveModules( ){
	//DoActivate( "", false );
}

function DoActivate(objectId, onlyDoModule){
    if( objectId==null ) objectId ="";
    if( onlyDoModule==null ) onlyDoModule = false;
    
    var isInternetExplorer	= navigator.appName.indexOf("Microsoft") != -1;
    //Determine browser, we only need this for Internet Explorer
    if (isInternetExplorer) {

        //Array of elements to be replaced
        var arrElements = new Array(3);
        arrElements[0] = "object";
        arrElements[1] = "embed";
        arrElements[2] = "applet";


        //Loop over element types
        for ( var n = 0; n < arrElements.length; n++) {

	        //set object for brevity
	        replaceObj = document.getElementsByTagName(arrElements[n]);
        	
	        //loop over element objects returned
	        for ( var i = 0; i < replaceObj.length; i++ ) {
        	    
        	    //only activate the required component -- else every thing will be re-writed
        	    if(onlyDoModule && replaceObj[i].id!=objectId) continue;
        	    
		        //set parent object for brevity
		        parentObj = replaceObj[i].parentNode;
        		
		        //grab the html inside of the element before removing it from the DOM
		        newHTML = parentObj.innerHTML;
        		
		        //remove element from the DOM
		        parentObj.removeChild(replaceObj[i]);
        		
		        //stick the element right back in, but as a new object
		        parentObj.innerHTML = newHTML;
	        }
        }
    }
}

function MxDownload( downloadArgs ){
	document.all["ifr_download"].src = "Download.aspx" + downloadArgs;
}



// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --]

var message="";
///////////////////////////////////
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")

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --]


// script is part of swf-object solution ----------------------------------------------

// fix for video streaming bug
cleanupSWFs = function() {
	if (window.opera || !document.all) return;
	var objects = document.getElementsByTagName("OBJECT");
	for (var i=0; i < objects.length; i++) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in fp9 see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
prepUnload = function() {
	__flash_unloadHandler = function(){};
	__flash_savedUnloadHandler = function(){};
	if (typeof window.onunload == 'function') {
		var oldUnload = window.onunload;
		window.onunload = function() {
			cleanupSWFs();
			oldUnload();
		}
	} else {
		window.onunload = cleanupSWFs;
	}
}

if (typeof window.onbeforeunload == 'function') {
	var oldBeforeUnload = window.onbeforeunload;
	window.onbeforeunload = function() {
		prepUnload();
		oldBeforeUnload();
	}
} else {
	window.onbeforeunload = prepUnload;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --]
