
var hWnd;

	function openwin(img , w , h , title )
	{
		if(hWnd!=null)
		hWnd.close();
		hWnd=window.open(img,"","toolbar=no,location=no,directories=no,resizable=no,width=" + w + ",height=" + h );
		hWnd.document.open();
		hWnd.document.write("<html>");
		hWnd.document.write("<head>");
		hWnd.document.write("<title>" + title + "</title>");
		hWnd.document.write("</head>");
		hWnd.document.write("<body bgcolor=#ffffff bottommargin=0 leftmargin=0 marginheight=0 marginwidth=0 rightmargin=0 topmargin=0 style='border:0px;'>");
		hWnd.document.write("<table align=center width=100% height=100% cellspacing=0 cellpadding=0 border=0>");
		hWnd.document.write("<tr><td><img src='"+img+"' border=0></td></tr>");
		hWnd.document.write("</table></body></html>");
		hWnd.document.close();
	}

	function pics( img , url ) {
			document.images[img].src = url;
	}

	function redirect( uri ) {
		document.location.href=uri;
	}


	function IEPngFix( img , width , height , unique_name ) {

		var code = '<IMG SRC="'+ img +'" WIDTH="' + width + '" HEIGHT="' + height + '" BORDER=0 name="'+ unique_name +'">';
		if( navigator.userAgent.indexOf("Opera") > 1 )
			document.write(code);
		else
			if( navigator.userAgent.indexOf("MSIE 6") > 1 )
				document.write('<IMG SRC="/img/emp.gif" WIDTH="' + width + '" HEIGHT="' + height + '" BORDER="0" ALT="" name="'+ unique_name +'" STYLE="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader (src=' + img + ' , sizingMethod=scale );">');
			else
				if(navigator.userAgent.indexOf("MSIE 5") != -1)
					document.write(code);
				else
					document.write(code);
					
	}

	function IEPngFixMap( img , width , height , unique_name ) {

		var code = '<IMG SRC="'+ img +'" WIDTH="' + width + '" HEIGHT="' + height + '" BORDER=0 name="'+ unique_name +'" usemap="#map1">';
		if( navigator.userAgent.indexOf("Opera") > 1 )
			document.write(code);
		else
			if( navigator.userAgent.indexOf("MSIE 6") > 1 )
				document.write('<IMG SRC="/img/emp.gif" WIDTH="' + width + '" HEIGHT="' + height + '" BORDER="0" ALT="" usemap="#map1" STYLE="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader (src=' + img + ' , sizingMethod=scale );">');
			else
				if(navigator.userAgent.indexOf("MSIE 5") != -1)
					document.write(code);
				else
					document.write(code);
					
	}

	function IETilePng( img , width , height ) {
		if( navigator.userAgent.indexOf("MSIE 7") > 1 ) {
			//alert( width.screenWidth )
			//document.write('<IMG SRC="/img/emp.gif" WIDTH="' + width + '" HEIGHT="' + height + '" BORDER="0" ALT="" usemap="#map1" STYLE="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader (src=' + img + ' , sizingMethod=scale );">');
		}
	}
 
	function ShowDiv( id ) {
		var layer = document.getElementById(id);
			layer.style.display = "block"; 
	}

	function HideDiv( id ) {
		var layer = document.getElementById(id);
			layer.style.display = "none"; 
	}

	function show( id ) {
		var layer = document.getElementById(id);
		if( layer.style.display == "none" )
			layer.style.display = "block"; 
		else
			layer.style.display = "none"; 
	}

	function colorChange( id , bgColor ) {
		var el = document.getElementById( id );
		el.style.backgroundColor = bgColor;
	}

	function openwin_text( url , w , h ) {
		window.open(url,"","toolbar=no,location=no,directories=no,resizable=no,scrollbars=yes,width="+w+",height="+h);
	}

	function startScroll( dir , spd ) {
		FrameDocument = frame1.document;
		page = eval( "FrameDocument.getElementById('content').style" );
		speed = 10;
		direction = "right";
		scrolltimer = null;
		loop = true;
		x_pos = parseInt( page.left );

		speed = parseInt( spd );
		direction = dir;
		if ( loop == true ) {
			if ( (direction == "left") && (x_pos > -1081+541 ) ) {
				page.left = x_pos - speed;
			}
			else {
				if (direction == "right" && x_pos < -4 ) {
					page.left = x_pos + speed;
				}
			}
		}

		scrolltimer = setTimeout( "startScroll( direction , speed )" , 1 );
	}

	function stopScroll() {
		loop = false;
		clearTimeout( scrolltimer );
	}

	function showLayer( id ) {
		var l = document.getElementById( id );
		l.style.display = 'block';
	}

	function hideLayer( id ) {
		var l = document.getElementById( id );
		l.style.display = 'none';
	}

	function preload() {
		var numArgs = arguments.length;
		if ( numArgs > 0 ) {
			arr = new Array()
			for( var i = 0; i < numArgs; i++ ) {
				arr[i] = new Image();
				arr[i].src = arguments[i];
			}
		}
	}
	function Showmenu() {
		Hidemenu();
		var i,TopPosition,args = Showmenu.arguments;
		for (i=0; i<(args.length); i+=1) {
			if (document.layers) { // NN 4.xx
				eval('var CurrentLayer = document.layers[\'' + args[i] + '\'];');
				if (CurrentLayer) CurrentLayer.visibility = 'show';
				document.layers['HideLayer'].visibility = 'show';
			}
			else { // IE 4+, NN 6.xx, Opera 6.xx
				eval('var CurrentLayer = document.getElementById(\'' + args[i] + '\');');
				if (CurrentLayer) CurrentLayer.style.visibility = 'visible';
				CurrentLayer = document.getElementById('HideLayer');
				CurrentLayer.style.visibility = 'visible';
			}
		}
	}


	function Hidemenu() {
		var LayersCollection,i,CurrentLayerID,Currentlayer;
			LayersCollection = document.getElementsByTagName("div");
			for (i=0; i<LayersCollection.length; i+=1) {
				CurrentLayerID = LayersCollection[i].id;
				if (CurrentLayerID.indexOf('Layer') >= 0) {
					eval('Currentlayer = document.getElementById(\'' + CurrentLayerID + '\');');
					Currentlayer.style.visibility = 'hidden';
				}
			}
	}
