// reads url parameters in the form of ?variable1=mama, is called directly on load to make variable global!!!
var CS='CS'
var DE='DE'
var IT='IT'
var EN='EN'
var FR='FR'
if (document.location.search!=""){

	params=document.location.search.substring(1);
	param=params.split('&');
	for (i=0;i<param.length;i++){
  //alert(param[i])
  
		eval(param[i]);
	}
}

function loadimg(img) {		// loads a single image
	var a=new Image();
	a.src=img;
	return a;
}

function preload(buttons,path){ // loads a bunch of images, stored in the array 'button', preceded by path 
	for (j=0;j<buttons.length;j++){
		eval( buttons[j] + "_a=loadimg('" + path + "pic/" + buttons[j] + "_a.gif')");
		eval( buttons[j] + "_i=loadimg('" + path + "pic/" + buttons[j] + "_i.gif')");
	}
}


function setMenu(){		// reads the varibles toptheme and subtheme from content page and updates the top- and submenuframes, if necessary
	if (parent.inhalt.subtheme&&parent.mitte.activate){
		parent.mitte.activate(parent.inhalt.subtheme);
	}
}

function scrollit(direction){	// scrolls the textlayer up or down
	if (document.all) endscroll=document.all['text'].offsetHeight-(240-position);
	else endscroll=document.layers['text'].document.height-(240-position);

	if(endscroll>0||direction>0){
		position=position+direction*4; 
		if (position>1) position=1;
		moveLayer('text', 210, position);
	}
	if (myscroll==1) setTimeout('scrollit(' + direction + ');',20);
}

function resetscroll(){		// resets the textlayer
		moveLayer('text', 210,1);
}

function detailpop(url){	// opens the detail-window
//	alert(url);
	dpop=window.open(url,'detailpop','width=610,height=300,scrollbars=yes');
}

function bigpop(url){	// opens the detail-window
	bpop=window.open(url,'detailpop','width=610,height=450,scrollbars=yes');
}

function funktionpop(url){	// opens the function-window
	fpop=window.open(url,'funktionpop','width=345,height=512');
}


function contact(){		//calls the contact popup with product support
	dpop=window.open('sluzby/kontakt_form.html','detailpop','width=610,height=340,scrollbars=yes');
}

function topcontact(){		//calls the contact popup with product support
	dpop=window.open('sluzby/kontakt_form.html','detailpop','width=610,height=340,scrollbars=yes');
}

function index(){
	dpop=window.open('sluzby/roto.chm','detailpop','width=610,height=340,scrollbars=yes');
}

function layerWrite(id,text){ // writes content into a layer
	text='<table width=305 height=100><tr><td valign=center>' + text + '</td></tr></table>';
	if (document.layers) {
		var lyr = document.layers[id].document;
		lyr.open();
		lyr.write(text);
		lyr.close();
	}
	
	else document.all[id].innerHTML = text
}

/********************************************************************
* These functions allow dynamic HTML effects to be added to any     *
* web page and will work on both Netscape Communicator 4.0+ and MS  *
* Internet Explorer 4.0+ browsers.                                  *
********************************************************************/

function hideLayer(name) {
  var layer = getLayer(name);
  if (document.layers) layer.visibility = "hide";
  if (document.all) layer.visibility = "hidden";
}

function showLayer(name) {
  var layer = getLayer(name);
  if (document.layers) layer.visibility = "show";
  if (document.all) layer.visibility = "visible";
}

function moveLayer(name, x, y) {

  var layer = getLayer(name);

  if (document.layers)
    layer.moveTo(x, y);
  if (document.all) {
    layer.left = x;
    layer.top  = y;
  }
}

function setImgSrc(imagename, imagesrc) {

  var i, layer;

  // If the image exists in the document object, change the source.

  if (document.images[imagename]) {
    document.images[imagename].src = "pic/" + imagesrc;
    return;
  }

  // Otherwise, for Netscape, search through the layers for the named image.

  else if (document.layers) {
    var found = false;
    for (i = 0; i < document.layers.length && !found; i++) {
      if (document.layers[i].document.images[imagename]) {
        document.layers[i].document.images[imagename].src = imagesrc;
        found = true;
      }
    }
  }
}

function getLayer(name) {

  // Returns a handle to the named layer.

  if (document.layers)
    return(document.layers[name]);
  else if (document.all) {
    layer = eval('document.all.' + name + '.style');
    return(layer);
  }
  else
    return(null);
}


