function open_picture(u,w,h,max_w,max_h) {
	if (window.screen) {
		max_w = window.screen.width - 20;
		max_h = window.screen.height - 53;
	}
	win_w = w + 0;
	win_h = h + 0;
	if (win_w > max_w) win_w = max_w;
        if (win_h > max_h) win_h = max_h;
	win = window.open(u,"NewWin","width=" + win_w + ", height=" + win_h + ",scrollbars=auto,resizable=1,resizable=yes");
        return(win);
}

function open_picture1(u,w,h,max_w,max_h) {
	if (window.screen) {
		max_w = window.screen.width - 20;
		max_h = window.screen.height - 53;
	}
	win_w = w + 0;
	win_h = h + 0;
	if (win_w > max_w) win_w = max_w;
        if (win_h > max_h) win_h = max_h;
	win = window.open('','',"width=" + win_w + ", height=" + win_h + ",scrollbars=auto,resizable=1,resizable=yes");
	win.document.open();
	win.document.write('<body bgcolor=#F1F2F2 leftMargin=0 rightMargin=0 topMargin=0 marginwidth=0 marginheight=0>');
	win.document.write('<img width=' + w + ' height=' + h + ' src="' + u + '">');
	win.document.close();
 	win.focus();
        return(win);
}

function quote(nick,id) {
	var selectedText =  null;
	var quote_mesg = '<Q'+(nick == '' ? '' : ' '+nick)+'>';
	if (document.selection)
		selectedText = document.selection.createRange();
	if (selectedText != null && selectedText.text) {
		mesg = selectedText.text;
	} else {
		eval('mesg = mesg'+id+';');
	}
	quote_mesg += mesg + "</Q>\n";
	if (document.forms['message'].message) {
		//document.forms['message'].message.innerText += quote_mesg;
		document.forms['message'].message.value += quote_mesg;
		document.forms['message'].message.focus();
	} else {
		//document.forms['message'].content.innerText += quote_mesg;
		document.forms['message'].content.value += quote_mesg;
		document.forms['message'].content.focus();
	}
	return true;
}

	
	function show(number) {
		for (var i=1;i<=15;i++) {
			document.getElementById('map_'+i).style.visibility = (i==number)?'visible':'hidden';
		}
		return(false);
	}
	function showpreview(x,y,co) {
		a=parseInt(y)-parseInt(co);
		b=parseInt(x)+parseInt(co);
		c=parseInt(y)+parseInt(co);
		d=parseInt(x)-parseInt(co);
		document.getElementById('scheme_a').style.clip='rect('+a+','+b+','+c+','+d+')';
		
	}
	function hidepreview() {
		document.getElementById('scheme_a').style.clip='rect('+temp+')';
	}


