var mainframe="framedef1";

function test()
{ 
  if (top.frames.length==0) { window.location.href="http://www.primax-berlin.de/index.htm"; } 
     else if (top.frames[0].name!=mainframe) { window.location.href="http://www.primax-berlin.de/index.htm"; }
}

// Menü-Zeile

clicker=0;
timerr = window.setTimeout("nothing()",1);


function change(x)
{
	window.clearTimeout(timerr);
	document.images[0].src="./struct/menu"+x+".jpg";
}


function back()
{
	timerr = window.setTimeout("leftit()",300);
}	

function leftit()
{
	document.images[0].src="./struct/menu"+clicker+".jpg";
}	

function gedrueckt(x)
{
	window.clearTimeout(timerr);
	clicker = x;
	if (x==1) { parent.inhalt.location.href="./produkte/medstart.htm"; }
	if (x==2) { parent.links.location.href="./quality/start.htm"; }
	if (x==3) { parent.links.location.href="./kondis/start.htm"; }
	if (x==4) { parent.inhalt.location.href="./about/inhalt.htm"; }
	if (x==5) { parent.links.location.href="./kontakt/start.htm"; }
}

function nothing()
{ }

// Produkt-Menü

var first_over=0;
var last_over=0;
var last_click=0;
var timerfunc=null;
var inactive_link='white';
var active_link='black';

var menu_full_gray='../../all/menu_links-gray.jpg';
var menu_full_color='../../all/menu_links-full.jpg';
var menu_parts=new Array('../../all/menu_links-1.jpg','../../all/menu_links-2.jpg','../../all/menu_links-3.jpg','../../all/menu_links-4.jpg','../../all/menu_links-5.jpg','../../all/menu_links-6.jpg');

function showchose(i)
{
  if (first_over==0) 
  { 
    document.getElementById('background').style.backgroundImage='url('+menu_full_gray+')';
    first_over=1; 
  }
  if ((last_over!=0) && (last_over!=last_click)) 
  { 
    document.getElementById(last_over).style.backgroundImage='none'; 
    document.getElementById(last_over).style.color=inactive_link; 
  }
  last_over=i;
  document.getElementById(i).style.backgroundImage='url('+menu_parts[i-1]+')';
  document.getElementById(i).style.color=active_link;
  if (timerfunc!=null) 
  { 
    clearTimeout(timerfunc); 
    timerfunc=null; 
  }
}

function restore_timer(i)
{
  timerfunc = setTimeout("restore_active("+i+")", 100);
}

function restore_active(i)
{
  if (last_click!=i)
  {
    document.getElementById(i).style.color=inactive_link;
    document.getElementById(i).style.backgroundImage='none'; 
  }
  if (last_click==0) 
  { 
    document.getElementById('background').style.backgroundImage='url('+menu_full_color+')'; 
    first_over=0;
    last_over=0; 
  }
}

function setfocus(i)
{
  if ((last_click!=0) && (last_click!=i)) { 
                        document.getElementById(last_click).style.backgroundImage='none';
                        document.getElementById(last_click).style.color=inactive_link;
                      }
  last_click=i;
  document.getElementById(last_click).style.color=active_link;
}

function preload_pics()
{
  var pics = new Array(6);
  var t=0;
  var i=true;
  for (var t=0;t<8;t++)
  { pics[t] = new Image(); }
  pics[0].src='../../all/menu_links-full.jpg';
  pics[1].src='../../all/menu_links-gray.jpg';
  for (var t=2;t<8;t++)
  { pics[t].src='../../all/menu_links-'+(t-1)+'.jpg'; } 
}

// ÜBer

function override_menu()
{
  menu_full_gray='../../all/menu_about_bg.jpg';
  menu_full_color='../../all/menu_about_full.jpg';
  menu_parts=new Array('../../all/menu_about-1.jpg','../../all/menu_about-2.jpg');
}

// Qualitätsmanagement 

function openw(locatio)
{
 z = window.open(locatio,"Certificates","height=800,width=550,resizable=YES,scrollbars=YES,status=NO,menubar=NO,location=NO");
} 

// Stapelfunktion

function toTop(iStart,iThis,iEnd)
{

        iStartZ=iEnd-iStart+1;iAdd=-1;iRun=iThis;
        if (document.getElementById(iThis).style.zIndex!=iStartZ)
        {
                for (t=0;t<(iEnd-iStart)+1;t++)
                {
                        document.getElementById(iRun).style.zIndex=iStartZ;
                        document.getElementById(iRun+"_x").style.display='none';
                        iRun=iRun+iAdd; 
                        if (iRun<iStart) 
                        { 
                                iRun=iThis+1;
                                iAdd=1; 
                        }
                        iStartZ--;
                }
                document.getElementById(iThis+"_x").style.display='inline';
        }

}

