//search
if (ssearch=document.getElementById('search_theme_form')) {
  //search button
  var s_op = ssearch.elements['op'];
  var newInput = document.createElement('INPUT');
  newInput.setAttribute('name', 'op');
  newInput.setAttribute('type', 'image');
  newInput.setAttribute('src', var_bpath+'themes/aaa/search.png');
  newInput.setAttribute('title', var_stext);
  newInput.style.verticalAlign = 'middle';
  s_op.parentNode.replaceChild(newInput, s_op);
  //search text
  var st_field = ssearch.elements[0];
  st_field.value = var_stext;
  st_field.onfocus = function() {
    this.style.backgroundColor = '#fc0';
    if (this.value==var_stext) {
      this.value = '';
    }
  }
  st_field.onblur = function() {
    this.style.backgroundColor = 'transparent';
    if (this.value=='') {
      this.value = var_stext;
    }
  }
  //search onsubmit
  ssearch.onsubmit = function() {
    if (st_field.value==var_stext || st_field.value.length<3) {
      alert(var_swarn);
      this.elements[0].focus();
      return false;
    }
  }
}

//menu bar
var m_i, m_ikonlar = document.getElementById('ikonlar').getElementsByTagName('A');
var m_baslik = document.getElementById('altmetin').innerHTML;
for (var i=0; m_i=m_ikonlar[i]; i++) {
  if (document.location.href == m_i.href) {
    m_i.firstChild.src = m_i.firstChild.src.replace(/(\/ico_)/, '/over_ico_');
    continue;
  }
  m_i.onmouseover = function() {
    this.firstChild.src = this.firstChild.src.replace(/(\/ico_)/, '/over_ico_');
    document.getElementById('altmetin').innerHTML = this.title;
  }
  m_i.onmouseout = function() {
    this.firstChild.src = this.firstChild.src.replace(/(\/over_ico_)/, '/ico_');
    document.getElementById('altmetin').innerHTML = m_baslik;
  }
}

//urun resim popup
if (u_table=document.getElementById('uruntablosu')) {
  var u_r, u_resim = u_table.getElementsByTagName('IMG');
  for(var i=0; u_r=u_resim[i]; i++) {
    u_r.style.cursor = 'pointer';
    u_r.alt = var_enl;
    u_r.onclick = function(){
     urnpop = window.open(this.src.split('.png')[0]+'_ori.jpg', '', 'width=500, height=400, menubar=0, scrollbars=1, statusbar=0, resizable=0');
    }
  }
}
