
	String.prototype.is_string = true;

	function Element( ID ) { return document.getElementById( ID ); }

	function Elements( Obj, Tag ) {
		Obj = Obj.is_string ? Element(Obj) : Obj;

		return Obj.getElementsByTagName( Tag.toUpperCase() );
	}

	function DisplayHeader( file ) {
		if( !file ) file = '';

		var swf	= new SWFObject('images/swf/header' + file + '.swf', 'header', '800', '184', '8', '#fff');
		swf.addParam("wmode", "transparent");
		swf.write('header');
	}

	function DisplayBanner( file ) {
		if( file ) {
			var swf	= new SWFObject('images/swf/banner.swf', 'header', '562', '150', '8', '#fff');
			swf.addParam("wmode", "transparent");
			swf.write('banner');
		}
	}

	function DisplayBanner2( file ) {
		if( file ) {
			var swf	= new SWFObject('images/swf/thermo.swf', 'header', '562', '150', '8', '#fff');
			swf.addParam("wmode", "transparent");
			swf.write('banner2');
		}
	}

	function BoxOperate() {
		var Divs	= Elements( document, 'div' );
		var count	= Divs.length;

		for( var i = 0; i < count; i++ ) {
			if( Divs[i].className.indexOf('box') >= 0 ) {
				var img1	= document.createElement( 'IMG' );
				var img2	= document.createElement( 'IMG' );
				var img3	= document.createElement( 'IMG' );
				var img4	= document.createElement( 'IMG' );

				img1.setAttribute( 'alt', '' );
				img2.setAttribute( 'alt', '' );
				img3.setAttribute( 'alt', '' );
				img4.setAttribute( 'alt', '' );

				img1.className	= 'left-top';
				img2.className	= 'right-top';
				img3.className	= 'left-bottom';
				img4.className	= 'right-bottom';

				img1.setAttribute( 'src', 'images/left-top-angle.gif' );
				img2.setAttribute( 'src', 'images/right-top-angle.gif' );
				img3.setAttribute( 'src', 'images/left-bottom-angle.gif' );
				img4.setAttribute( 'src', 'images/right-bottom-angle.gif' );

				Divs[i].appendChild( img1 );
				Divs[i].appendChild( img2 );
				Divs[i].appendChild( img3 );
				Divs[i].appendChild( img4 );
			}
		}
	}

	function EntryOperate() {
		var Inputs	= Elements( document, 'input' );
		var count	= Inputs.length;

		for( var i = 0; i < count; i++ ) {
			if( Inputs[i].className.indexOf('entry') >= 0 ) {
				var Left	= document.createElement('IMG');
				Left.setAttribute( 'src', 'images/entry-left.gif' );
				Left.style.verticalAlign = 'top';
				Left.style.marginTop = '1px';
				Left.setAttribute( 'alt', '' );

				var Right	= document.createElement('IMG');
				Right.setAttribute( 'src', 'images/entry-right.gif' );
				Right.style.verticalAlign = 'top';
				Right.setAttribute( 'alt', '' );
				Right.style.marginTop = '1px';

				/*@cc_on
					@if (@_jscript_version <= 5.6)
						Right.style.marginTop = '2px';
						Left.style.marginTop = '2px';
					@end
				@*/

				Inputs[i].style.verticalAlign = 'top';

				Inputs[i].parentNode.insertBefore( Left, Inputs[i] );

				if( Inputs[i].nextSibling )
					Inputs[i].parentNode.insertBefore( Right, Inputs[i].nextSibling );
				else
					Inputs[i].parentNode.appendChild( Right );
			}
		}
	}

	function OperateMenu( ID ) {
		var Menu	= Element( ID );
		var List	= Elements( Menu, 'li' );
	
		for( var i=0; i < List.length; i++ ) {
			if( List[i].className != 'lang' ) {
				List[i].onmouseover	= function() { if( this.className == '' ) this.className = 'drop'; }
				List[i].onmouseout	= function() { if( this.className == 'drop' ) this.className = ''; }
			}
		}
	
		Menu.className += ' drop';
	}

	function Beautify( subpage, banner ) {
		if( subpage ) subpage = 2;

		OperateMenu('menu-general');
		if( Element('menu') )
			OperateMenu('menu');
		DisplayHeader( subpage );
		DisplayBanner( banner );
		DisplayBanner2( banner );
		EntryOperate();
		BoxOperate();
	}


