horizontal_offset=Math.round((screen.availWidth-760-20)/2);
if (horizontal_offset<0) horizontal_offset=0;

function LinkActive(status_text, id) {
	window.status=status_text;
	if (id) {
		g=document.getElementById(id);
		g.src="graphics/active/"+id+".gif";
	}
}

function LinkPassive(id) {
	window.status="";
	if (id) {
		g=document.getElementById(id);
		g.src="graphics/"+id+".gif";
	}
}

menu_status_text=new Array();
menu_status_text["gyongy"]="Miért GYÖNGY?";
menu_status_text["gyongyi"]="Gál Gyöngyi";
menu_status_text["terem"]="A GYÖNGY forma-terem";
menu_status_text["torna"]="A torna hatásai";
menu_status_text["orarend"]="Órarend";
menu_status_text["arak"]="Áraink";
menu_status_text["elerhetoseg"]="Elérhetőség";

function LinkMenuActive(type, id) {
	window.status=menu_status_text[id];
	id="menu_"+id;
	g=document.getElementById(id);
	image="graphics/active/"+type+"_"+id;
	if (type=="main") image+=".jpg";
	else image+=".gif";
	g.src=image;
	if (type=="main") RentHide();
	else RandomShell();
}

function LinkMenuPassive(type, id) {
	window.status="";
	id="menu_"+id;
	g=document.getElementById(id);
	image="graphics/"+type+"_"+id;
	if (type=="main") image+=".jpg";
	else image+=".gif";
	g.src=image;
}

function RandomShell() {
	random=Math.floor(Math.random()*4+1);
	while (random==actual_shell)
		random=Math.floor(Math.random()*4+1);
	g=document.getElementById("shell_"+random);
	g.style.visibility="visible";
	if (actual_shell) {
		g=document.getElementById("shell_"+actual_shell);
		g.style.visibility="hidden";
	}
	actual_shell=random;
}

function PopUpImage(id, type, width, height) {
	x=screen.availWidth-10-width;
	if (x<0) x=0;
	window.open("enlarged/"+id+".html", "large_image", "left="+x+", top=0, width="+width+", height="+height);
}

function Lecture(id) {
	window.open("lectures/"+id+".html", "lecture", "left=0, top=0, width=512, height=576");
}

function LectureBill(id, type, width, height) {
	window.open("lectures/"+id+".html", "lecture", "left=0, top=0, width="+width+", height="+height);
}

function RentShow() {
	g=document.getElementById("rent");
	g.style.visibility="visible";
}

function RentHide() {
	g=document.getElementById("rent");
	g.style.visibility="hidden";
}

function PopUpImage(id, type, width, height) {
	x=screen.availWidth-10-width;
	if (x<0) x=0;
	window.open("enlarged/"+id+".html", "large_image", "left="+x+", top=0, width="+width+", height="+height);
}

function EMail(string) {
	alphabet = new Array("@", " ", ".", "!", "-", "_", "&#34;", "<", ">", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "á", "b", "c", "d", "e", "é", "f", "g", "h", "i", "í", "j", "k", "l", "m", "n", "o", "ó", "ö", "ő", "p", "q", "r", "s", "t", "u", "ú", "ü", "ű", "v", "w", "x", "y", "z", "A", "Á", "B", "C", "D", "E", "É", "F", "G", "H", "I", "Í", "J", "K", "L", "M", "N", "O", "Ó", "Ö", "Ő", "P", "Q", "R", "S", "T", "U", "Ú", "Ü", "Ű", "V", "W", "X", "Y", "Z");
	email_array=string.split("#");
	email="";
	for (i=0; i<email_array.length; i++) {
		j=email_array[i];
		email+=alphabet[j];
	}
	return email;
}
