
function stopError (  ) { return true; }
window.onerror = stopError;

function launch_pop( wURL, wNAME, wWIDTH, wHEIGHT, wX, wY )
{
	var x = null;
	
	wX = ( screen.width  != null ) ? screen.width  / 2 - wWIDTH  / 2 : 0;
	wY = ( screen.height != null ) ? screen.height / 2 - wHEIGHT / 2 : 0;
	
	wPARAM  = "left=" + wX + ",top=" + wY + ",WIDTH=" + wWIDTH + ",HEIGHT=" + wHEIGHT;
	wPARAM += ",location=no,resizable=no,titlebar=no,directories=no,toolbar=no,menubar=no,scrollbars=no,status=no";

	x = window.open( wURL, wNAME, wPARAM );
	x.focus(  );
	
}

function launch_img_pop( wIMG )
{
	// open popup outside of window
	launch_pop( 'img.php?img=' + wIMG, 'impop', 50, 50 );
}

function send2friend( lng )
{
	// open popup outside of window
	launch_pop( 'send2friend.php?lng='+lng, 's2fpop', 250, 350 );
}

function resize_move_self( w, h )
{
	nw = w + 50;
	nh = h + 50;
	window.moveTo( -nw, -nh );
	window.resizeTo( w, h );
	nw = ( screen.width  != undefined ) ? screen.width  / 2 - w  / 2 : 0;
	nh = ( screen.height != undefined ) ? screen.height / 2 - h / 2 : 0;
	window.moveTo( nw, nh );
}

function change_content( d1, d2, d3, txt )
{
	d   = document;
	txt = txt.replace( /\"/gi, "\\\"" );
	js  = '';
	
	if( document.all || document.getElementById )
	{
		js  = "c=d.getElementById? d.getElementById(\""+d3+"\"):d.all."+d3+";\n";
		js += "if(c!=undefined){ c.innerHTML=\""+txt+"\" }";
	}
	else if( document.layers )
	{
		js  = "if( d."+d1+" != undefined ){\n";
		js += "d."+d1+".visibility=\"show\";\n";
		js += "d."+d1+".document."+d2+".document.write(\""+txt+"\");\n";
		js += "d."+d1+".document."+d2+".document.close();\n}";
	}
	
	if( js != '' )
		eval(js);
}
