


window.onload = function () {
	
	var img = new Array('http://www.csabahorvath.hu/img/rejtettmagy.gif','http://www.csabahorvath.hu/img/menu/icon11.gif','http://www.csabahorvath.hu/img/menu/icon22.gif','http://www.csabahorvath.hu/img/menu/icon33.gif','http://www.csabahorvath.hu/img/menu/icon44.gif','http://www.csabahorvath.hu/img/menu/icon55.gif','http://www.csabahorvath.hu/img/menu/icon66.gif','http://www.csabahorvath.hu/img/menu/icon77.gif','http://www.csabahorvath.hu/img/menu/icon88.gif','http://www.csabahorvath.hu/img/menu/vigyazz2.gif');
	var ism = new Array('af','df','cf','at','bt');
	preloadimage(img);
	
	if(document.getElementById) {
//menu up  ******************************************************************
			for(var i=1; i<9; i++) {
				var tag="weblap"+i;
				objek=document.getElementById(tag);
				objek.style.backgroundImage="url(http://www.csabahorvath.hu/img/menu/icon"+i+".gif)";
				objek.onmouseover=over;	
				objek.onmouseout=out;
			}
//bubbles ********************************************************************	
		for(var i=0; i<ism.length; i++) {
			if (document.getElementById(ism[i])) {
				span=document.getElementById(ism[i]);
				span.onmouseout=out;
				span.onmouseover=over;
				
			}
		}
	}
//bubbles end ****************************************************************
}


function preloadimage(url) {
	var img = new Array();
	for(var i=0; i<url.length; i++) {
		img[img.length]=new Image();
		img[img.length-1].src=url[i];
	}
}

function over(e) {
	if (!e) var e=window.event;
	thislink = (e.target) ? e.target: e.srcElement;
//menu ************************************************************************
	if (thislink.id.substring(0,6)=='weblap') {
		var szam=thislink.id.substring(6);
		this.style.backgroundImage="url(http://www.csabahorvath.hu/img/menu/icon"+szam+szam+".gif)";
	} else {
//menu end ************************************************************************	

//bubbles *************************************************************************	
		
		
		var IE = document.all?true:false;
		if (!IE) document.captureEvents(Event.MOUSEMOVE);
		
		function getMouseXY(e) {
		  if (IE) {
			tempX = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
			tempY = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	
			obj.style.top=tempY-145; //+ ;
			obj.style.left=tempX-35;// + document.body.scrollLeft;
			//alert(document.body.scrollTop);
			document.onmousemove = '';
			document.onmousemove = getMouseXY;
		  } else {
			tempX = e.pageX;
			tempY = e.pageY;
			obj.style.top=tempY-145+"px";
			obj.style.left=tempX-35+"px";
			document.onmousemove = '';
			document.onmousemove = getMouseXY;
		  }  
		  if (tempX < 0){tempX = 0;}
		  if (tempY < 0){tempY = 0;}  
		}
		
		obj=document.getElementById(thislink.id+"1");
		obj.style.top=-145+"px";
		obj.style.left=-35+"px";
		obj.style.display="block";
		
		document.onmousemove = getMouseXY;
		
		var tempX = 0;
		var tempY = 0;
		
		
	

	}
//bubbles end *********************************************************************

}
function out(e) {
	if (!e) var e=window.event;
	thislink = (e.target) ? e.target: e.srcElement;
//menu ****************************************************************************
	if (thislink.id.substring(0,6)=='weblap') {
		var szam=thislink.id.substring(6);
		this.style.backgroundImage="url(http://www.csabahorvath.hu/img/menu/icon"+szam+".gif)";
	} else {
//menu end ************************************************************************	

//bubbles *************************************************************************	
		document.onmousemove = '';
		obj=document.getElementById(thislink.id+"1");
		obj.style.display="none";
		
	}
//bubbles end *********************************************************************
}


function torol(ell,mi) {
	if(mi=='belepnev') {
		objer=document.getElementById('belepnev');
		if (ell==1) { 
			if(objer.value=='' || objer.value==' :: név ::') { objer.value=''; }
			objer.style.backgroundColor="#ffffff"; 
		}
		if (ell==2) {
			if (objer.value=='') { objer.value=" :: név ::"; objer.style.backgroundColor="#ececec"; }
		}
	} else
	if(mi=='jelszo') {
		objer=document.getElementById('jelszo');
		if (ell==1) {
			if(objer.value=='' || objer.value==' :: jelszó ::') { objer.value=''; }
			objer.style.backgroundColor="#ffffff"; 
		}
		if (ell==2) {
			if (objer.value=='') { objer.value=" :: jelszó ::"; objer.style.backgroundColor="#ececec"; }
		}
	}
	if(mi=='foglalt') {
		objer=document.getElementById('foglalt');
		if (ell==1) {
			if(objer.value=='' || objer.value=='foglalt-e ez a domain...') { objer.value=''; }
			
		}
		if (ell==2) {
			if (objer.value=='') { objer.value="foglalt-e ez a domain...";  }
		}
	}
	if(mi=='keres') {
		objer=document.getElementById('keres');
		if (ell==1) {
			if(objer.value=='' || objer.value=='keresés az oldalon...') { objer.value=''; }
			
		}
		if (ell==2) {
			if (objer.value=='') { objer.value="keresés az oldalon...";  }
		}
	}
}

function beir() {
 url="http://www.csabahorvath.hu/beir.php";
 window.open(url,"beir","width=590,height=435,top=28,left=8,scrollbars=0,resizable=0");
}

function mezo(param,color) {
	document.getElementById(param).style.backgroundColor=color;
}