function popup(url,name,width,height,scrollbar,wplus,hplus,focus,left,top,menubar,status,toolbar,resizable,scrx,scry,directories,loc) {
	if ( !url ) return false;
	if ( !name ) name = 'popupWin';
	if ( !width ) width = '';
	if ( !height ) height = '';
	if ( !directories ) directories = 'no';
	if ( !loc ) loc = 'no';
	if ( !menubar ) menubar = 'no';
	if ( !status ) status = 'no';
	if ( !toolbar ) toolbar = 'no';
	if ( !scrollbar ) scrollbar = 'no';
	if ( !resizable ) resizable = 'no';
	if ( !scrx ) scrx = '100';
	if ( !scry ) scry = '100';
	if ( !left ) left = '100';
	if ( !top ) top = '100';
	if ( wplus ) width  += wplus;
	if ( hplus ) height += hplus;

    var popupWin = window.open(url,name,'width='+width+'px,height='+height+'px,left='+left+',top='+top+',menubar='+menubar+',status='+status+',toolbar='+toolbar+',scrollbars='+scrollbar+',resizable='+resizable+',screenX='+scrx+',screenY='+scry+'directories='+directories+',location='+loc);

	if ( focus ) popupWin.focus();
}

var old_id = '';
var is_opened  = 'none';

function toggle( id ) {

    id_obj = document.getElementById(id);
    is_opened = id_obj.style.display;

	if (document.getElementById('a01') !== null && id != 'a01')
	{
		document.getElementById('a01').style.display = 'none';
	}

    if (old_id != '' && is_opened == 'none') {
        old_id_obj = document.getElementById(old_id);
        old_id_obj.style.display = 'none';		
    }

    if (old_id != id || is_opened == 'none') {
        id_obj.style.display = 'block';
    }

    old_id = id;
}

function toggle_info() {
	document.getElementById('info').style.display = (document.getElementById('info').style.display == 'block') ? 'none' : 'block';
	document.getElementById('back').style.display = (document.getElementById('back').style.display == 'block') ? 'none' : 'block';
}

var old_id_event = '';
var is_opened_event  = 'none';

function toggleevent( id ) {

    id_obj = document.getElementById(id);
    is_opened_event = id_obj.style.display;

    if (is_opened_event == 'block') {
		if (id == 'a01') {
			document.getElementById('arch01').className = 'archivum fleft ml20';
		} else {
			document.getElementById('arch02').className = 'archivum fleft ml100';
		}		
        id_obj.style.display = 'none';
    } else {
		if (id == 'a01') {
			document.getElementById('arch01').className = 'archivum fleft ml20 archivum_hover';
		} else {
			document.getElementById('arch02').className = 'archivum fleft ml100 archivum_hover';
		}		
		id_obj.style.display = 'block';   
    }
	
    old_id_event = id;
}

function innerDimension() {
	var x,y;

	// all except Explorer
	if (self.innerHeight)
	{
		x = self.innerWidth;
		y = self.innerHeight;

	// Explorer 6 Strict Mode
	} else if (document.documentElement && document.documentElement.clientHeight) {
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	
	// other Explorers
	} else if (document.body) {
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}

	return {width: x, height: y};
}

function offsetDimension() {
	var x,y;

	// all except Explorer
	if (self.pageYOffset)
	{
		x = self.pageXOffset;
		y = self.pageYOffset;

	// Explorer 6 Strict
	} else if (document.documentElement && document.documentElement.scrollTop) {
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;

	// all other Explorers
	} else if (document.body) {
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}

	return {x: x, y: y}
}

