

function changeLocale(loc){
	top.locale=loc;
	// remove locale from pagename
	if(top.lastPage.substring(top.lastPage.length-3,top.lastPage.length)=="_en"){
		top.lastPage=top.lastPage.substring(0,top.lastPage.length-3);
	}
	if(loc=="DE") {
		parent.content.document.location=top.lastPage+".htm";
		parent.foot.document.location="foot.htm";
	} else if (loc=="EN") {
		parent.content.document.location=top.lastPage+"_en.htm";
		parent.foot.document.location="foot_en.htm";
	}
}


function toggle_dropmenu(id)
{
	count = 1;
	while (count <= 4)
	{
		var step = id+'_'+count;
		if (document.getElementById(step))
			document.getElementById(step).style.display = (document.getElementById(step).style.display == 'block') ? 'none' : 'block';
		count++;
	}
}


function roll_dropmenu(id, roll_class)
{
	document.getElementById(id).className = roll_class;
}


function load(url){
	document.location=url+".htm";
	top.lastPage=url;
}

function MenuButton(b_id,b_label,b_link,b_status){
	this.bid=b_id;
	this.blabel=b_label;
	this.blink=b_link;
	this.bstatus=b_status;
}

function SubMenuEntry(b_id,b_label,b_link){
	this.sid=b_id;
	this.slabel=b_label;
	this.slink=b_link;
}

function displayButton(but){
	// main button
	var click = "";
	if(but[0].blink.substring(0,3)=="sub"){
		click = "onClick=\"toggle_dropmenu('"+but[0].blink+"')\"";
	} else {
		click = "onClick=\"load('"+but[0].blink+"')\"";
	}
 	document.write("<td valign='top' "+click+" onMouseOver=\"window.status='"+but[0].bstatus+"'\" onMouseOut=\"window.status='Homepage VERON PHARMA'\">");
 	document.write("<table cellspacing='0' cellpadding='0'><tr><td>");
 	document.write("<div id='"+but[0].bid+"' class='Main_menu' onmouseover=\"roll_dropmenu('"+but[0].bid+"','Main_menu_over')\" onmouseout=\"roll_dropmenu('"+but[0].bid+"','Main_menu')\">"+but[0].blabel+"</div>");
 	
	//sub entries
 	for(j=1;j<but.length;j++){
 		document.write("<div id='"+but[j].sid+"' class='Sub_menu' onClick=\"load('"+but[j].slink+"')\" onmouseover=\"roll_dropmenu('"+but[j].sid+"','Sub_menu_over')\" onmouseout=\"roll_dropmenu('"+but[j].sid+"','Sub_menu')\" style='display: none'>"+but[j].slabel+"</div>");	
 	}
	// shadow
	document.write("</td></tr><tr><td class='border'></td></tr></table></td>");
}

var menu;
function init(){
	menu = new Array(4);

	menu[0]= new Array(1);
	menu[1]= new Array(1);
	menu[2] = new Array(3);
	menu[3] = new Array(4);
	menu[4] = new Array(1);

	if(top.locale=="EN"){
		menu[0][0] = new MenuButton('main_1','Home','welcome_en','Home of VERON PHARMA');
		menu[1][0] = new MenuButton('main_2','Company','profile_en','Information about VERON PHARMA');
		menu[2][0] = new MenuButton('main_3','Products','sub_3','Information about products of VERON PHARMA');
		menu[2][1] = new SubMenuEntry('sub_3_1','Import-medicine','imports_en');
		menu[2][2] = new SubMenuEntry('sub_3_2','Ronfnyl','ronfnyl_en');
		menu[3][0] = new MenuButton('main_4','Contact','sub_4','Contact VERON PHARMA');
		menu[3][1] = new SubMenuEntry('sub_4_1','Address','contact_en');
		menu[3][2] = new SubMenuEntry('sub_4_2','Documentation physicians','info_doc_en');
		menu[3][3] = new SubMenuEntry('sub_4_3','Documentation pharmacists','info_apo_en');
		menu[4][0] = new MenuButton('main_5','Links','links_en','Links');
	} else {
		menu[0][0] = new MenuButton('main_1','Home','welcome','Zur Startseite von VERON PHARMA');
		menu[1][0] = new MenuButton('main_2','Unternehmen','profile','Informationen zum Unternehmen VERON PHARMA');
		menu[2][0] = new MenuButton('main_3','Produkte','sub_3','Informationen zu Produkten von VERON PHARMA');
		menu[2][1] = new SubMenuEntry('sub_3_1','Importarzneimittel','imports');
		menu[2][2] = new SubMenuEntry('sub_3_2','Ronfnyl','ronfnyl');
		menu[3][0] = new MenuButton('main_4','Kontakt','sub_4','Kontakt zu VERON PHARMA');
		menu[3][1] = new SubMenuEntry('sub_4_1','Adresse','contact');
		menu[3][2] = new SubMenuEntry('sub_4_2','Infomaterial &Auml;rzte','info_doc');
		menu[3][3] = new SubMenuEntry('sub_4_3','Infomaterial Apotheken','info_apo');
		menu[4][0] = new MenuButton('main_5','Links','links','Links');;
	}
}

function menu(){
 init();
 document.write("<tr height='20'><td>");
 document.write("<table cellspacing='0' cellpadding='0'><tr><td valign='top'>");
 document.write("<table cellspacing='0' cellpadding='0'><tr><td class='Main_menu'>&nbsp;</td></tr><tr><td class='border'></td></tr></table></td>");
 for(i=0;i<menu.length;i++) displayButton(menu[i]);	
 document.write("<td valign='top'>");
 document.write("<table cellspacing='0' cellpadding='0'><tr><td class='menu'>&nbsp;</td></tr><tr><td class='border'></td></tr></table>");
 document.write("</td></tr></table></td></tr>");
}