<!--
var Anim = YAHOO.util.Anim;
var Dom = YAHOO.util.Dom;
var Element = YAHOO.util.Element;
var yEvent = YAHOO.util.Event;
var Connect = YAHOO.util.Connect;
var IE = YAHOO.env.ua.ie;
var Firefox = YAHOO.env.ua.gecko;

var alertBg, alertBox, request;
var pageIsLoaded, loaded;
var lang = 'ro';


YAHOO.namespace('page');

YAHOO.page.init = function pageInit()
{
	lang = Dom.get('pageHeader').innerHTML;
	//window.onresize = function(){ YAHOO.page.resizeContent(); }
	//YAHOO.page.resizeContent();
	YAHOO.page.fixMinHeights();
	YAHOO.accordion.init();
	setTimeout("YAHOO.page.callbackInit()",500);
	if (document.getElementById('h1'))
	{
		var h1 = document.getElementsByTagName('h1')[0];
		h1.parentNode.removeChild(h1);
		Dom.get('h1').appendChild(h1);
	}
}

YAHOO.page.fixMinHeights = function fixMinHeights()
{
	var minHeightCells = Dom.getElementsByClassName('pageContentBody');
	var cell1 = Dom.getRegion(minHeightCells[0]).height;
	var cell2 = Dom.getRegion(minHeightCells[1]).height;
	//if (cell2<cell1) Dom.setStyle(minHeightCells[1],'min-height',(cell1-10)+'px');	
	
	//Dom.setStyle(minHeightCells[1],'min-height',(Dom.getRegion(minHeightCells[0]).height-10)+'px');
	if (IE>0)
	{
		var setHeight = (IE<7) ? 'height' : 'min-height';
		if (portfolioPicHeight>0)
		{
			var portfH = Dom.getRegion('callBackForm').bottom - Dom.getRegion('accordion').top;
			Dom.setStyle(minHeightCells[0],setHeight,portfH-10+'px');
			Dom.setStyle(minHeightCells[1],setHeight,portfH+'px');
		}
		else
		{
			if (cell1<cell2) Dom.setStyle(minHeightCells[0],setHeight,(Dom.getRegion(minHeightCells[1]).height-20)+'px');
			if (cell2<cell1) Dom.setStyle(minHeightCells[1],setHeight,(Dom.getRegion(minHeightCells[0]).height-10)+'px');
		}
	}
	else
	{
		Dom.setStyle(minHeightCells[1],'min-height',(Dom.getRegion(minHeightCells[0]).height-10)+'px');
	}
	return true;
}

YAHOO.page.callbackInit = function pageCallbackInit()
{
	if (document.getElementById('callBackContent').innerHTML == '') 
	YAHOO.request.get('callBackContent',URL_ROOT+'ajax/callback/callback.php');
}


YAHOO.page.preloader = function pagePreloader()
{
	loaded=false;
	if (navigator.appName != "Microsoft Internet Explorer")
		{
		YAHOO.util.Dom.setStyle('preloader','top', window.pageYOffset + 'px');	
		}
		
	for (i=0; i<document.images.length; i++)
	{
		//if (document.images[i].complete) loaded=true;
		//	else loaded=false
		loaded = document.images[i].complete;
	}

	if (!loaded) setTimeout("YAHOO.page.preloader()",100);
	else setTimeout("YAHOO.page.hide()",500)
}

YAHOO.page.hide = function() {
	pageIsLoaded=true;
	var attributes = {
		opacity: { to:0 }
	}
	var preloaderFade = new Anim('preloader',attributes,0.25,YAHOO.util.Easing.easeIn);
	preloaderFade.onComplete.subscribe(function(){ Dom.setStyle('preloader', 'display', 'none'); })
	preloaderFade.animate();
}



var portfolioPicHeight = 0;
function checkPortfolioPicHeight()
{
	if (portfolioPicHeight>-1)
	{
		var tempHeight = Dom.getRegion('portfolioBigPic').height;
		if (tempHeight!=portfolioPicHeight)
		{
			portfolioPicHeight = tempHeight;
			YAHOO.page.fixMinHeights();
		}
	}
}

/***************************
 * A J A X   R E Q U E S T *
 ***************************/


	YAHOO.namespace('request');
	
	
	YAHOO.request.get = function requestGet(divID, url)
	{

		var container=document.getElementById(divID);
		if (container) container.innerHTML = "<img src='"+URL_ROOT+"library/style/loading.gif'/>";
		
		var handleSuccess = function(o){
			if(o.responseText !== undefined){
				if (container) container.innerHTML = o.responseText;
				YAHOO.page.fixMinHeights();
			}
		}
	
		var handleFailure = function(o){
			if(o.responseText !== undefined){
				if (container) container.innerHTML = "Ajax Error! (" + o.statusText + ")<br />";
				YAHOO.page.fixMinHeights();
			}
		}	
		
		var callback =
		{
		  success:handleSuccess,
		  failure:handleFailure,
		  cache:false,
		  timeout:5000
		};
		
		//var t = new Date();
		request = Connect.asyncRequest('GET', url, callback);
	}
	 
	 
	YAHOO.request.post = function requestPost(divID, url, postData, uploadForm)
	{
		if ((divID=='commandBox' || divID=='whoisDiv') && Dom.get('commandBoxForm')) Connect.setForm(Dom.get('commandBoxForm'));

		var container=document.getElementById(divID);
		container.innerHTML = "<img src='"+URL_ROOT+"library/style/loading.gif'>";
	
		var handleSuccess = function(o){
			if(o.responseText !== undefined){
				container.innerHTML = o.responseText;
				YAHOO.page.fixMinHeights();
			}
		}
	
		var handleFailure = function(o){
			if(o.responseText !== undefined){
				container.innerHTML = "Ajax Error! (" + o.statusText + ")";
				YAHOO.page.fixMinHeights();
			}
		}	
		
		var callback =
		{
		  success:handleSuccess,
		  failure:handleFailure,
  		  cache:false,
		  timeout:5000
		};

/*
		var date = new Date();
		var ms = date.getTime();
		rnd = (url.indexOf('rnd=')<0) ? '&rnd='+ms : '';
		*/
		request = Connect.asyncRequest('POST', url, callback, postData);
	}




/*******************
 * A L E R T B O X *
 ********************/


	YAHOO.namespace('showAlertBox');
	
	
	function showAlert(message)
	{
		alertBg = document.createElement("div");
		alertBg.id = "alertBg";
		Dom.addClass(alertBg,"alertBg");
		Dom.setStyle(alertBg,"height",Dom.getDocumentHeight()+"px");
		Dom.setStyle(alertBg,"width",Dom.getDocumentWidth()+"px");
		document.body.appendChild(alertBg);
		yEvent.addListener(alertBg,"mouseup",YAHOO.showAlertBox.removeBox);
		
		alertBox = document.createElement("div");
		alertBox.id = "alertBox";
		alertBox.innerHTML = "<table height='100%' align='center'><tr valign='middle' height='70%'><td>"+message+"</td></tr><tr height='30%'><td><input type='button' value='OK' class='alertButton' onmouseup='YAHOO.showAlertBox.removeBox()'></td></tr></table>";
		Dom.addClass(alertBox,"alertBox");
		Dom.setStyle(alertBox,"left",parseInt(Dom.getDocumentWidth()/2-200)+"px");
		document.body.appendChild(alertBox);
		YAHOO.showAlertBox.fadeIn();
	}
	
	
	YAHOO.showAlertBox.fadeIn = function showAlertBoxFadeIn() 
	{
		startY = Dom.getDocumentScrollTop()-150;
		finishY = parseInt(Dom.getDocumentScrollTop()+Dom.getViewportHeight()/2-75);
	
		var attributes = { 
			top: { from:startY, to:finishY }, 
			opacity: { from:0, to:1 }
		}; 
	
		var alertBoxAnim = new Anim(alertBox.id, attributes, 0.5, YAHOO.util.Easing.easeOut); 
			alertBoxAnim.animate();
	}
	
	
	YAHOO.showAlertBox.removeBox = function showAlertBoxRemoveBox()
	{
		var attributes = { 
			opacity: { from:1, to:0 }
		}; 
	
		var alertBoxAnim = new Anim(alertBox.id, attributes, 0.2, YAHOO.util.Easing.easeOut); 
			alertBoxAnim.onComplete.subscribe(YAHOO.showAlertBox.removeBg);
			alertBoxAnim.animate();
	}


	YAHOO.showAlertBox.removeBg = function showAlertBoxRemoveBg()
	{
		var attributes = { 
			opacity: { from:1, to:0 }
		}; 
	
		var alertBgAnim = new Anim(alertBg.id, attributes, 0.2, YAHOO.util.Easing.easeOut); 
			alertBgAnim.onComplete.subscribe(YAHOO.showAlertBox.remove);
			alertBgAnim.animate();
	}


	YAHOO.showAlertBox.remove = function showAlertBoxRemove()
	{
		alertBg.parentNode.removeChild(alertBg);
		alertBox.parentNode.removeChild(alertBox);
	}



/*********************
 * A C C O R D I O N *
 *********************/
  
  
	YAHOO.namespace('accordion');
	var accItem, accActive=0, rollOverImg;
	var accItemHeight = new Array(150,150,200,120,51,59);
	
	
	YAHOO.accordion.init = function accordionInit()
	{
		accItem = Dom.getChildren('accordion');
		
		var url = document.location.href.toString();
		url = url.substr(url.lastIndexOf('/')+1);
		switch(url)
		{
			case '':
			case 'firma-web-design.html':
			case 'oferta-web-design.html':
			case 'echipa-emerigos.html':
			case 'web-design-ceg.html':
			case 'web-design-ajanlat.html':
			case 'emerigos-csapat.html':
			case 'web-design-company.html':
			case 'web-design-offer.html':
			case 'emerigos-web-design-team.html':
				accActive = 0; break;
			case 'avantajele-site-web.html':
			case 'realizare-pagini-web.html':
			case 'webdesign.html':
			case 'website-elonyei.html':
			case 'weboldal-keszites.html':
			case 'advantages-of-a-website.html':
			case 'creating-web-pages.html':
				accActive = 1; break;
			case 'creare-pagina-web.html':
			case 'inregistrare-domenii.html':
			case 'web-hosting.html':
			case 'optimizare-motoare-cautare.html':
			case 'identitate-vizuala.html':
			case 'honlapkeszites.html':
			case 'domain-nev-regisztracio.html':
			case 'web-tarhely-hosting.html':
			case 'keresomotor-optimizalas.html':
			case 'cegarculat-tervezes.html':
			case 'creating-webpages.html':
			case 'domain-registration.html':
			case 'web-hosting.html':
			case 'search-engine-optimization.html':
			case 'visual-identity.html':
				accActive = 2; break;
			case 'portfoliu-web-design-oradea.html':
			case 'parerea-clientilor.html':
			case 'web-design-portfolio-oradea.html':
			case 'klienseink-velemenye.html':
			case 'portfolio-web-design-oradea.html':
			case 'clients-opinion.html':
				accActive = 3; break;
			case 'intrebari-frecvente.html':
			case 'gyakran-ismetelt-kerdesek.html':
			case 'faq.html':
				accActive = 4; break;
			case 'contact.php':
			case 'kapcsolat.html':
			case 'contact.html':
				accActive = 5; break;
			default:
				accActive = 3; break;
		}
		
		for (i=0; i<accItem.length; i++)
		{
			yEvent.addListener(accItem[i].id,'click',YAHOO.accordion.open,accItem[i])
			//yEvent.addListener(accItem[i].id,'mouseover',YAHOO.accordion.open,accItem[i])
			//yEvent.addListener(accItem[i].id,'mouseout',YAHOO.accordion.close,accItem[i])
		}
		YAHOO.accordion.open('',accItem[accActive]);
	}
	
	
	YAHOO.accordion.open = function accordionOpen(e,obj)
	{

		//YAHOO.accordion.rollOver(obj);

		for (i=0; i<accItem.length; i++)
		{
			if (accItem[i].id==obj.id)
			{
				var attributes = { 
				   height: { to:accItemHeight[i] } 
				}; 
			}
			else
			{
				minHeight=(i==accItem.length-1)?53:51;
				var attributes = { 
					height: { to:minHeight } 
				}; 

			}

			var accAnim = new Anim(accItem[i].id, attributes, 0.2); 
			accAnim.animate();
		}
	}



/*********************
 * A N I M A T I O N *
 *********************/

YAHOO.namespace('basicAnim');


	//panel kinyitasa/bezarasa
	YAHOO.basicAnim.toggleBox = function basicAnimToggleBox(obj,w,h,cw,ch)
	{
		if (cw==undefined) cw=0;
		if (ch==undefined) ch=0;
		var length = obj.indexOf('Holder');
		/*
		var opener = Dom.get(obj.substr(0,length) + 'Opener');
		if (opener.innerHTML == '[megnyit]') opener.innerHTML = '[bez&aacute;r]';
		else if (opener.innerHTML == '[bezár]') opener.innerHTML = '[megnyit]';
		*/
		var _opened = (Dom.getStyle(obj,'display') == 'none') ? false : true;
		if (!_opened)
		{
			Dom.setStyle(obj,'display','block');
			var attributes = { 
				height: { to:h },
				width: { to:w },
				unit: '%'
			};
		}
		else
		{
			var attributes = { 
				height: { to:ch },
				width: { to:cw }
			};
		}
		
		var myAnim = new Anim(obj,attributes,0.2,YAHOO.util.Easing.easeOut);
		if (_opened) myAnim.onComplete.subscribe(function() { Dom.setStyle(obj,'display','none'); });
		myAnim.animate();
	}



/***************
 * S C R O L L *
 ***************/

YAHOO.namespace('scroll');
var containerHeight = 0;
var scrollInterval;
	
	//scroll inicializalasa
	YAHOO.scroll.init = function scrollInit(id)
	{
		containerHeight = parseInt(Dom.getStyle(id,'height'));
//		var innerContainerHeight = Dom.getStyle('inner_' + id,'height');

//		if (innerContainerHeight > containerHeight)
		{
			Dom.setStyle('scrollUpContainer_' + id,'display','block');
			Dom.setStyle('scrollDownContainer_' + id,'display','block');
		}
		
		/*
		yEvent.addListener('scrollDownContainer_infoBox','mouseover',YAHOO.scroll.down()
																					   */
		var obj = Dom.getElementsByClassName('scroller');
		var speed = 150;
		for(var i=0; i<obj.length; i++)
		{
			if (obj[i].id.indexOf('scrollDownContainer_infoBox')>-1)
			{
				var o = obj[i];
				yEvent.addListener(obj[i].id,'mouseover',function(){ scrollInterval = setInterval("YAHOO.scroll.continous('infoBox"+o.id.substr(27)+"',1)",speed) });
				yEvent.addListener(obj[i].id,'mouseout',function(){ clearInterval(scrollInterval) });
			}
			if (obj[i].id.indexOf('scrollUpContainer_infoBox')>-1)
			{
				var o = obj[i];
				yEvent.addListener(obj[i].id,'mouseover',function(){ scrollInterval = setInterval("YAHOO.scroll.continous('infoBox"+o.id.substr(27)+"',-1)",speed) });
				yEvent.addListener(obj[i].id,'mouseout',function(){ clearInterval(scrollInterval) });
			}
		}
	}


	//scroll fel
	YAHOO.scroll.up = function scrollUp(id)
	{
		var scrollUp = document.getElementById(id).scrollTop - containerHeight*0.9;
		var scrollAtr = {
			scroll: { to:[0,scrollUp] }
		}
		var sUp = new YAHOO.util.Scroll(id,scrollAtr,0.2,YAHOO.util.Easing.easeOut);
		sUp.animate();
	}

	//scroll le
	YAHOO.scroll.down = function scrollDown(id)
	{
		var scrollDown = document.getElementById(id).scrollTop + containerHeight*0.9;
		var scrollAtr = {
			scroll: { to:[0,scrollDown] }
		}
		var sDown = new YAHOO.util.Scroll(id,scrollAtr,0.2,YAHOO.util.Easing.easeOut);
		sDown.animate();
	}
	
	YAHOO.scroll.continous = function scrollContinous(id,dir)
	{
		var scrollBar = document.getElementById(id);
		scrollBar.scrollTop += 20*dir;
	}



yEvent.onDOMReady(YAHOO.page.init);
-->