var W = window;
var D = document;
var DA = document.all;
var PW = parent.window;
var WA = window.dialogArguments;

var index = 100;
function show_obj( obj, opt ){
	
	var tag = DA.tags("select");
	for( i in tag ){
		if( DA[i].name ){
			DA[i].style.visibility = "hidden";
		}
	}

	index ++;
	document.all[obj].style.display = "block";
	document.all[obj].style.zIndex = index;
		
	if( opt == 1 ){
		w = document.all[obj].scrollWidth;
		h = document.all[obj].scrollHeight;
		document.all[obj].style.left = ( document.body.clientWidth - w )/2;
		document.all[obj].style.top = ( document.body.clientHeight - h )/2;
	}
	else if( opt == 2 ){
		document.all[obj].style.left =  event.clientX;
		document.all[obj].style.top =  event.clientY - 60;
	}
}

function hide_obj( obj )
{
	var tag = DA.tags("select");
	for( i in tag ){
		if( DA[i].name )DA[i].style.visibility = "visible";
	}
	
	document.all[obj].style.display = "none";
	document.all[obj].style.zIndex = 0;
}

function ch_cl( obj_id, class_name ){
	D.all[obj_id].className = class_name;
}

function go( url, opt, tb, w, h, s, r ){
	
	if( !url )return false;
	
	l = ( screen.width - w )/2;
	t = ( screen.height - h )/2;
	if( !w )w = 700;
	if( !h )h = 500;
	if( !s )s = 1; else s = 0;
	if( !r )r = 1; else r = 0;
	if( !tb )tb = 1; else tb = 0;
	
	if( opt == 1 ){
		window.open( url, "_blank", "toolbar="+tb+",scrollbars="+s+",resizable="+r+",left="+l+",top="+t+",width="+w+",height="+h );
	}
	else if( opt == 2 ){
		window.open( url, "_blank" );
	}
	else{
		window.location.href = url;
	}
}

function go_( url ){
	window.setTimeout( "igo(\'"+url+"\')", 200 );
}

function igo( url ){
	DA['ifrm'].src = url;
}

var dialogurls = new Array( );

function mod( url, w, h, nr, m, s ){
	
	var d_args = new Array( );
	if( !w )w = 400; else res = "Yes";
	if( !h )h = 400; else res = "Yes";
	if( nr )res = "No"; else res = "Yes";
	if( s )sc = "No"; else sc = "auto";
	
	d_args[0] = window;
	prop = "dialogHeight: "+h+"px; dialogWidth: "+w+"px; edge: Raised; center: Yes; scroll: "+sc+"; help: No; resizable: "+res+"; status: No;";
	if( !m )W.showModelessDialog( url , d_args , prop );
	else W.showModalDialog( url , d_args , prop );
}

var prev_obja = 0;
function sca( obj, color, pcolor ){
	if( obj != prev_obja ){
		obj.style.background = color;
		if( prev_obja ){
			prev_obja.style.background = pcolor;
		}
	}
	prev_obja = obj;
}

function wcenter( w, h ){
	
	l = ( screen.width - w ) / 2;
	t = ( screen.height - h ) / 2;
	if( t < 40 )t = 40;
	window.moveTo( l, t - 40 );
	
}
