var pic=1;
var maxpic=6;
var opacity=100;
var opacityD=-25;
var timer;
var timer1;
var preload=new Image();


function init(){
timer1=setInterval ('go1("forward")',5000);
for(n=pic; n <= maxpic; n++) preload.src='/static/images/head/head_pic'+n+'.jpg';
}

function go1(where){
oldpic=pic;
if (where == "back") pic--;
if (where == "forward") pic++;
if (pic > maxpic)pic=1;
if (pic < 1)pic=maxpic;

clearInterval(timer);
timer=setInterval ('flash('+pic+')',30)
}

function go(where){
oldpic=pic;
if (where == "back") pic--;
if (where == "forward") pic++;
if (pic > maxpic)pic=1;
if (pic < 1)pic=maxpic;

clearInterval(timer);
clearInterval(timer1);
timer=setInterval ('flash('+pic+')',5)
}

function flash(pic){
opacity=opacity+opacityD;
document.getElementById('hpic').style.opacity=opacity/100;
document.getElementById('hpic').style.filter="alpha(opacity=" + opacity + ")";

if (opacity==0){
	document.getElementById('hpic').src="/static/images/head/head_pic"+pic+".jpg";
	opacityD=10;
	}
if (opacity==100){
	clearInterval(timer);
	preload.src="/static/images/head/head_pic"+(pic+1)+".jpg";
	opacityD=-10;
	}

}




function popup(obj) {
	var ns = (navigator.appName=="Netscape")?true:false;
	src=obj.src.replace("kicsi","nagy");
	OpenWindow=window.open("", "_blank", "toolbar=no,width=640,height=480,scrollbars=0,resizable=no,menubar=no");
	OpenWindow.document.write("<html>\n<head>\n<TITLE>Popup</TITLE>\n");
	OpenWindow.document.write("<script type='text/javascript'>\n");
	OpenWindow.document.write("function resize(){\n");
	OpenWindow.document.write("window.resizeTo(document.getElementById('pic').width , document.getElementById('pic').height + 50 );\n");
	OpenWindow.document.write("window.resizeBy( 30,  30);\n");
	OpenWindow.document.write("window.resizeBy(-30, -30);\n");
	OpenWindow.document.write("}\n ");
	OpenWindow.document.write("</script>\n</head>\n");
	OpenWindow.document.write("<BODY  style='margin: 0 0 0 0;cursor: hand;'>\n");
	OpenWindow.document.write("<img onload='resize();' style='margin: 0 0 0 0;cursor: hand;' onclick='window.close();' border='0' id='pic' name='pic' src='"+src+"'>\n");
	OpenWindow.document.write("<script type='text/javascript'>\n resize();\n</script>");
	OpenWindow.document.write("</BODY>\n");
	OpenWindow.document.write("</HTML>\n");
	OpenWindow.document.close();
}

function im(a){
	var b = ".hu";
	document.write(' <a href="mailto:' + a + '@' + b + '">' + a + '@' + b + '</a>');
}


