var IE=document.all;
var inputImg;
	


// IMAGE-CHANGE function --------------------

function changeImg(inputImg,show) {

	if (show=="true") eval('document.' +inputImg +'.src = "img/arrow_red_right.gif"');
	else eval('document.' +inputImg +'.src = "img/pix.gif"');
}

// End IMAGE-CHANGE function ----------------



// MENU-components --------------------------

var counter = 0;
var menuItem = new Array();

function menuObject(id,title,parent) {

	this.id	     = id;
	this.title   = title;
	this.parent  = parent;
	this.extended = 0;
}

// End MENU-components ----------------------



// Build MENU--------------------------------

function defineExtended(section) {

	var parentExtended=0;

	for (i=0; i<menuItem.length; i++) {
		if (section == menuItem[i].id || section == menuItem[i].parent) {
			menuItem[i].extended = 1;
			if (menuItem[i].parent != 0) parentExtended = menuItem[i].parent;
		}
	}
	if (parentExtended != 0)
		for (i=0; i<menuItem.length; i++) {
			if (parentExtended == menuItem[i].id || parentExtended == menuItem[i].parent) {
				menuItem[i].extended = 1;
			}
		}
}

// End Build MENU----------------------------



// Open TEMPLATES----------------------------

function windowOpener(URL,width,height) {

	var left = (screen.width / 2) - (width / 2);		
	var top = (screen.height / 2) - (height / 2);

	if (IE) height=height;
	else height = height+17;

	window.open(URL,'index','width=' +width +',height=' +height +',left=' +left +',top=' +top +',scrollbars=no');
}

// End Open TEMPLATES------------------------

// Start klickbar bild------------------------

function viewPic(img)
{ 	
    picfile = new Image(); 
    picfile.src =(img); 
    fileCheck(img); 
}

function fileCheck(img)
{ 	
    if( (picfile.width!=0) && (picfile.height!=0) )
    { 
        makeWindow(img); 
    }
    else 
    {
        funzione="fileCheck('"+img+"')"; 
        intervallo=setTimeout(funzione,50); 
    }
}

function makeWindow(img)
{ 	
    ht = picfile.height + 18;
    wd = picfile.width + 18; 

    var args= "height=" + ht + ",innerHeight=" + ht;
    args += ",width=" + wd + ",innerWidth=" + wd;
    if (window.screen) 
    { 
        var avht = screen.availHeight; 
        var avwd = screen.availWidth;
        var xcen = (avwd - wd) / 2; 
        var ycen = (avht - ht) / 2;
        args += ",left=" + xcen + ",screenX=" + xcen;
        args += ",top=" + ycen + ",screenY=" + ycen + ",resizable=yes"; 	
    }
    return window.open(img, '', args); 
}

// End klickbar bild------------------------


