function checkEnter(e){ //e is event object passed from function invocation
    var characterCode //literal character code will be stored in this variable
//    window.alert(e);
    if(e && e.which){ //if which property of event object is supported (NN4)
        e = e;
        characterCode = e.which; //character code is contained in NN4's which property
    }else{
	e = event;
        characterCode = e.keyCode; //character code is contained in IE's keyCode property
    }

    if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
	//document.forms[0].submit() //submit the form
	document.location.href='/kereses/'+document.getElementById('keres').value+'.html';
        return false;
    }else{
        return true;
    }
}

function titleWriter(txt,txtSize,txtColor,txtBold){                                                                                                                                                                                         
                                                                                                                                                                                                                                            
if (txt!=null){                                                                                                                                                                                                                             
txt=txt.replace(/ /g,"%20");                                                                                                                                                                                                                
txt=txt.replace(/á/g,"%c3%a1");                                                                                                                                                                                                             
txt=txt.replace(/Á/g,"%c3%81");                                                                                                                                                                                                             
txt=txt.replace(/é/g,"%c3%a9");                                                                                                                                                                                                             
txt=txt.replace(/É/g,"%c3%89");                                                                                                                                                                                                             
txt=txt.replace(/í/g,"%c3%ad");                                                                                                                                                                                                             
txt=txt.replace(/Í/g,"%c3%8d");                                                                                                                                                                                                             
txt=txt.replace(/ó/g,"%c3%b3");                                                                                                                                                                                                             
txt=txt.replace(/Ó/g,"%c3%93");                                                                                                                                                                                                             
txt=txt.replace(/ö/g,"%c3%b6");                                                                                                                                                                                                             
txt=txt.replace(/Ö/g,"%c3%96");                                                                                                                                                                                                             
                                                                                                                                                                                                                                            
txt=txt.replace(/õ/g,"%c3%b5");                                                                                                                                                                                                             
txt=txt.replace(/Õ/g,"%c3%95");                                                                                                                                                                                                             
                                                                                                                                                                                                                                            
txt=txt.replace(/ô/g,"%c3%b5");                                                                                                                                                                                                             
txt=txt.replace(/Ô/g,"%c3%95");                                                                                                                                                                                                             
                                                                                                                                                                                                                                            
txt=txt.replace(/ú/g,"%c3%ba");                                                                                                                                                                                                             
txt=txt.replace(/Ú/g,"%c3%9a");                                                                                                                                                                                                             
txt=txt.replace(/ü/g,"%c3%bc");                                                                                                                                                                                                             
txt=txt.replace(/Ü/g,"%c3%9c");                                                                                                                                                                                                             
txt=txt.replace(/û/g,"%c3%bb");                                                                                                                                                                                                             
txt=txt.replace(/Û/g,"%c3%9b");                                                                                                                                                                                                             
                                                                                                                                                                                                                                            
//txt=txt.replace(/</g,"%3c");                                                                                                                                                                                                              
//txt=txt.replace(/>/g,"%3e");                                                                                                                                                                                                              
                                                                                                                                                                                                                                            
txt=txt.replace(/\+/g,"%2b");                                                                                                                                                                                                               
                                                                                                                                                                                                                                            
txt=txt.replace(/uuu/g,"%c3%bb");                                                                                                                                                                                                           
txt=txt.replace(/UUU/g,"%c3%9b");                                                                                                                                                                                                           
//txt=txt.replace(/u/g,"%c3%bb");                                                                                                                                                                                                           
//txt=txt.replace(/U/g,"%c3%9b");                                                                                                                                                                                                           
                                                                                                                                                                                                                                            
}                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                            
if (txt==null)txt="Bababoo, mert másképp islehet : )";                                                                                                                                                                                                    
if (txtSize==null)txtSize="18";                                                                                                                                                                                                             
if (txtColor==null)txtColor="0x333333"                                                                                                                                                                                                      
if (txtBold==null)txtBold="true";                                                                                                                                                                                                           
                                                                                                                                                                                                                                            
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="460" height="36">');                                    
document.write('<param name="movie" value="/swf/headertext.swf?txt='+txt+'&size='+txtSize+'&bold='+txtBold+'&color='+txtColor+'" />');                                                                                                       
document.write('<param name="quality" value="high" />');                                                                                                                                                                                    
document.write('<param name="wmode" value="transparent" />');                                                                                                                                                                               
document.write('<embed src="/swf/headertext.swf?txt='+txt+'&size='+txtSize+'&bold='+txtBold+'&color='+txtColor+'" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="460" height="36"></embed>');
//document.write('<embed src="/swf/headertext.swf?txt='+txt+'&size='+txtSize+'&bold='+txtBold+'&color='+txtColor+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="460" height="36"></embed>');
document.write('</object>');
}

function adS(a){changeObjectVisibility(a, 'visible');}
function adH(a){changeObjectVisibility(a, 'hidden');}

function placeTermekSelect() { 
//	moveXY("termek_select", getElementLeft("termek_selectBtn"),158)
	} 

window.onload=placeTermekSelect;
window.onresize=placeTermekSelect;

function GetXmlHttpObject(){
var xmlHttp=null;
try  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }catch (e)  {
  // Internet Explorer
  try {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function stateChanged() {
    if (xmlHttp.readyState==4){
        document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
    }
}

function ajaxRequest(url, str){
        xmlHttp=GetXmlHttpObject();
        xmlHttp.onreadystatechange=function()  {
                if(xmlHttp.readyState==4) {
                        document.getElementById(str).innerHTML=xmlHttp.responseText;
//                      $.unblockUI();
                }
//              if(xmlHttp.readyState==1){
//                      $.blockUI('<img src="loading.gif">');
//              }
        }
        xmlHttp.open("GET",url,true);
        xmlHttp.send(null);
}

function addToBasket(){
    var valid = new Validation('basketForm', {onSubmit:false});
    var result = valid.validate();
    if (result){
    document.basketForm.submit();
    }
}

function orderSave(){
    var valid = new Validation('orderForm', {onSubmit:false});
    var result = valid.validate();
    if (result){
    document.orderForm.submit();
    }
}

function sizeGuide(){
    x=window.open("/sizeguide.html","sg","width=715,height=645,resizable=0,status=0,scrollbars=0,left=" + ((screen.width/2)-250) + ",top=" + ((screen.height/2)-225));
    x.focus();
    
}


