var speed, currentpos=curpos1=0,alt=1,curpos2=-1;

function galeria_index(kepek,break2,src){
	if (src== null){
		src='';
	}
	if (break2==null){
		break2=Math.ceil(kepek.length/3);
	}
	
	
	pre="<TABLE border='0' cellspacing='0' cellpadding='0'>";
	pre+="<TR>";
	pre+="<TD width='13'><IMG src='keret/bal_fent.gif' alt='' height='13' width='13' border='0'></TD>";
	pre+="<TD background='keret/fent.gif'><IMG src='keret/fent.gif' alt='' height='13' width='1' border='0'></TD>";
	pre+="<TD width='13'><IMG src='keret/jobb_fent.gif' alt='' height='13' width='13' border='0'></TD>";
	pre+="</TR>";
	pre+="<TR>";
	pre+="<TD width='13' background='keret/bal.gif'><IMG src='keret/bal.gif' alt='' height='1' width='13' border='0'></TD>";
	pre+="<TD bgcolor='white'>";
	
	post="</TD>";
	post+="<TD width='13' background='keret/jobb.gif'><IMG src='keret/jobb.gif' alt='' height='1' width='13' border='0'></TD>";
	post+="</TR>";
	post+="<TR>";
	post+="<TD width='13'><IMG src='keret/bal_lent.gif' alt='' height='13' width='13' border='0'></TD>";
	post+="<TD background='keret/lent.gif'><IMG src='keret/lent.gif' alt='' height='13' width='1' border='0'></TD>";
	post+="<TD width='13'><IMG src='keret/jobb_lent.gif' alt='' height='13' width='13' border='0'></TD>";
	post+="</TR>";
	post+="</TABLE>";

	document.writeln("<TR>");
	j=0;
	for(i=0;i<kepek.length;i++){
		if (j%break2==0){
			document.writeln("</TR><TR>");
		}
		j++;
		var fnev=kepek[i];
		fnev=fnev.toString();
		
		alpha=" style=\"filter:alpha(opacity=100)\" onMouseover=\" fade(this,0)\" onMouseout=\"fade(this,1)\"";
		
		//pages/"+(fnev)+".html
		document.write("<TD align=center>"+pre+"<A href='pic.php?id="+parseInt(fnev,10)+"' onMouseover='window.parent.scrollspeed=0;'><IMG "+alpha+" src='"+src+"images/small/"+(fnev)+".jpg' border=0></A>"+post+"</TD>");
	}
	document.writeln("</TR>");
	
}


function gen_array(from,to){
	var x=new Array();
	var j=0;
	var temp=0;
	
	for(var i=from;i<=to;i++){
		temp=i+1000;
		x[j]=temp.toString().substring(1,4);
		j++;
	}
	
	return x;
}



function initialize(){
	if (window.parent.scrollspeed!=0){
		speed=window.parent.scrollspeed;
		scrollwindow();
	}
}



function scrollwindow(){
	var temp=(document.all)? document.body.scrollTop : window.pageYOffset;
	alt=(alt==0? 1 : 0);
	if (alt==0){
		curpos1=temp;
	}else{
		curpos2=temp;
	}

	window.scrollBy(speed,0);
}

setInterval("initialize()",20);



function fade(cur,which){
  if (which==0){
    cur.filters.alpha.opacity=80;
  }else{
    cur.filters.alpha.opacity=100;
  }
}


function mailTo(user,domain){
	document.location='mailto:'+user+'@'+domain;
	return false;
}