objects = new Array();
function isString ( str ) {
	return typeof str == 'string' || str instanceof String;
}

function changeImg ( imgObj, imgSrc ) {
	if ( !imgObj || !imgSrc ) return;
	if ( !isString(imgSrc) ) return;
	if ( !imgObj.src ) {
		if ( !isString(imgObj) ) return;
		if ( !objects[imgObj] ) {
			objects[imgObj] = document.getElementById(imgObj);
		}
		if ( !objects[imgObj] ) return;
		objects[imgObj].src = imgSrc;
	};
	imgObj.src = imgSrc;
}


function over(img,ref) { document.images[img].src = ref; }  
function out(img,ref)  { document.images[img].src = ref; } 
function ow(f,x,y){myWin=open(f,"displayWindow","width="+x+",height="+y+",status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");
myWin.focus();}
function popup(title,archivo,ancho,alto) {
	var hor;
	var ver;
	var ubix;
	var ubiy;
	ubix=ancho/2;
	ubiy=alto/2;
	hor= screen.width/2-ubix;
	ver= screen.height/2-ubiy;
	popwin=window.open("","_blank","left="+hor+",top="+ver+",toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=yes,resizable=no,width="+ancho+",height="+alto);
	popwin.document.open();
	popwin.document.write('<html><head><title>'+title+'</title></head><body bgcolor=white scroll=no   topmargin=0 leftmargin=0 rightmargin=0 bottomargin=0 marginheight=0 marginwidth=0>  <div style="position: absolute; top:0px;left:0px"><a href="javascript:window.close()">  <img src="'+archivo+'" width="'+ancho+'" border="0"></a></div></body></html>');
	popwin.document.close();
}
function popup_prn(title,archivo,ancho,alto) {
	var hor;
	var ver;
	var ubix;
	var ubiy;
	ubix=ancho/2;
	ubiy=alto/2;
	hor= screen.width/2-ubix;
	ver= screen.height/2-ubiy;
	popwin=window.open("","_blank","left="+hor+",top="+ver+",toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=yes,resizable=no,width="+ancho+",height="+alto);
	popwin.document.open();
	popwin.document.write('<html><head><title>'+title+'</title></head><body onload="window.print()" bgcolor=white scroll=no   topmargin=0 leftmargin=0 rightmargin=0 bottomargin=0 marginheight=0 marginwidth=0>  <div style="position: absolute; top:0px;left:0px"><a href="javascript:window.close()">  <img src="'+archivo+'" width="'+ancho+'" border="0"></a></div></body></html>');
	popwin.document.close();
}


function w ( url, width, height, left, top, target, title, content ) {
	if ( !url || !width || !height ) return true;
	if ( !target ) target = '_blank';
	if ( !left ) left = Math.round((screen.width - width)/2);
	if ( !top ) top = Math.round((screen.height - height)/2);
	myWin = open(	
		url,
		target,
		"width="+width+",height="+height+",left="+left+",top="+top+",status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=no"
	);
	if ( content ) {
		content = "<html>\r\n<head>\r\n<title>"+title+"</title>\r\n</head>\r\n<body>\r\n"+content+"\r\n</body>\r\n</html>";
		myWin.document.write(content);
	}
	myWin.focus();
	return false;
}

function l ( p, width, height, left, top, title ) {
	if ( !p || !p.href || !width || !height ) return true;
	if ( !left ) left = Math.round((screen.width - width)/2);
	if ( !top ) top = Math.round((screen.height - height)/2);
	if ( !title ) title = '';
	var content = "<style type='text/css'>\r\nhtml, body {padding:0; margin:0; background:#ffffff;}\r\n</style>\r\n";
	content += "<table width='100%' style='width:100%; height:100%;' cellpadding='0' cellspacing='0'><tr><td align='center'><img src='"+p.href+"' alt='"+title+"' title='"+title+"' /></td></tr></table>";
	return w(p.href, width, height, left, top, p.target, title, content);
}
