
function addEvent( obj, type, fn )
{
	if (obj.addEventListener) obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj[type+fn] = function() { fn.apply ( obj, [ window.event ] ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

function removeEvent( obj, type, fn )
{
	if (obj.removeEventListener) obj.removeEventListener( type, fn, false );
	else if (obj.detachEvent)
	{
		obj.detachEvent( "on"+type, obj[type+fn] );
		obj[type+fn] = null;
	}
}

addEvent( window, 'load', function() {
	try {
		var fdiv = document.getElementById( 'headervisual-zone' );
		fdiv.style.backgroundColor = '#A0B6C0';
		var children = fdiv.childNodes;
		//console.log( children.length );
		var o;
		for( var i = 0; i < children.length; i++ ) {
			o = children[i];
			//console.log( o.nodeName + " :: " + o.nodeType + " :: " + o );
			if( 'OBJECT' == o.nodeName && 1 == o.nodeType ) {
				//console.log( 'OBJECT CHANGE' );
				o.setAttribute( 'width', '100%' );
				o.setAttribute( 'id', 'royalflash' );
				if( true == o.hasChildNodes() ) {
					var c = o.childNodes;
					var cc;
					for( var x = 0; x < c.length; x++ ) {
						cc = c[x];
						if( 'EMBED' == cc.nodeName && 1 == cc.nodeType ) {
							//console.log( 'EMBED within OBJECT change' );
							cc.setAttribute( 'width', '100%' );
							cc.setAttribute( 'name', 'royalflash' );
						}
					}
				}
			} else if( 'EMBED' == o.nodeName && 1 == o.nodeType ) {
				//console.log( 'EMBED (no object ) CHANGE' );
				o.setAttribute( 'width', '100%' );
				o.setAttribute( 'name', 'royalflash' );
			}
		}
		try {
			//window.royalflash = document.forms[0].royalflash;
		} catch( e ) {}

	} catch( e ) {
		// console.log( e );
	}
});
