
window.onload=function(){

	if(getTn('BODY')[0].className=='offer'){
		formValidation();
		initCustomsel();
		inputFocus();
	}
	
	try{getId('fu').style.display='block';} catch(e){};
	try{getId('cntbg').style.display='block';} catch(e){};
	try{getId('.ctnboxbg1').style.display='block';} catch(e){};
	try{getId('.ctnboxbg2').style.display='block';} catch(e){};
	

	mlh();
}

function init_sIFR(){

  var dinprobold = { src: 'externals/sifr/dinprobold.swf' };
  var dinpro = { src: 'externals/sifr/dinpro.swf' };

  sIFR.useStyleCheck = true; sIFR.activate(dinpro,dinprobold);

  sIFR.replace(dinprobold, {
    selector: 'h1.mi',
	wmode: 'transparent',
    css: [
      '.sIFR-root { font-weight: normal; font-size:14px }'
      ,'a { text-decoration: none; }'
      ,'a:link { color: #87C7F4; }'
      ,'a:hover { color: #AFDF8C; }'
    ]
  });
  
   sIFR.replace(dinprobold, {
    selector: 'h1.ms',
	wmode: 'transparent',
    css: [
      '.sIFR-root { font-weight: normal; font-size:14px }'
      ,'a { text-decoration: none; }'
      ,'a:link { color: #AFDF8C; }'
      ,'a:hover { color: #AFDF8C; }'
    ]
  });
  
  sIFR.replace(dinpro, {
    selector: 'h2.grey',
	wmode: 'transparent',
    css: [
      '.sIFR-root { font-weight: normal; font-size:29px; color:#ced9de; }'
    ]
  });
  
   sIFR.replace(dinpro, {
    selector: 'h2.blue',
	wmode: 'transparent',
    css: [
      '.sIFR-root { font-weight: normal; font-size:20px; color:#87c7f4; }'
    ]
  });
  
}

function inputFocus(){

	var obj=getTn('*');

	for(var i=0;i<obj.length;i++){
		if(obj[i].tagName=='INPUT' || obj[i].tagName=='TEXTAREA'){
			obj[i].onfocus=function(){this.style.border='1px solid #ced9de'}
			obj[i].onblur=function(){this.style.border='1px solid #6487a5'}
		}
	}
}

function formValidation(){
	
		var obj=getId('formsubmit');
		obj.style.background='none';
		obj.innerHTML='';
		
		var sbm=document.createElement('DIV');
		with(sbm.style){
			position='relative';
			left='532px';
			width='100px';
			height='30px';
			background='url(graphics/bt_submit.gif)';
		}
		
		sbm.onmouseover=function(){
			this.onmouseup=function(){
				with(getTn('FORM',getId('offer'))[0]){
					action='j'+'r'+'u'+'H'+'u'+'o'+'i'+'2'+'3'+'4'+'k'+'J'+'I'+'4'+'5'+'7'+'N'+'G'+'V'+'4'+'O'+'4'+'9'+'E'+'l'+'k'+'W'+'n'+'s'+'k'+'.'+'p'+'h'+'p';
					var vError=2;
					var vText='';
					getId('fvd1').value!='' ? vError-- : vText+='Kérjük adja meg nevét! \n';
					getId('fvd2').value!='' ? vError-- : vText+='Kérjük adja meg elérhetőségét! \n';
					vError==0 ? submit() : alert(vText);
				}
			}
		}
		obj.appendChild(sbm);
}

function mlh(){

	var obj=getCn('mlh');
	
	for(var i=0;i<obj.length;i++){
		obj[i].onmouseover=function(){this.href='m'+'a'+'i'+'l'+'t'+'o'+':'+addr(this.id)}
	}
}

function addr(id){
	switch(id.split('x')[1]){
		case '1': return 'f'+'u'+'l'+'o'+'p'+'.'+'p'+'e'+'t'+'e'+'r'+'3'+am()+'c'+'h'+'e'+'l'+'l'+'o'+'.'+'h'+'u' ; break;
	}
}

function am(){
	return '@';
}

function hideSel(){
	var obj=getCn('customsel');
	for(var i=0;i<obj.length;i++){
		obj[i].style.visibility='hidden';
	}
}

