function catmid(ne,kac){
 for(i=1;i<5;i++){
  if(kac == i){
   eval("document.getElementById('catprod_"+ne+"_"+i+"').style.display='block'");
   eval("document.getElementById('catpri_"+ne+"_"+i+"').className=''");
  }else{
   eval("document.getElementById('catprod_"+ne+"_"+i+"').style.display='none'");
   eval("document.getElementById('catpri_"+ne+"_"+i+"').className=''");
  }
 }
}

function pen(pn,loc,w,h) {
  if(pn == 1) { pnc = 'yes'; } 
  if(pn == 0) { pnc = 'no'; }
	window.open(loc,"","width=" + w + ",height=" + h + ",scrollbars=" + pnc + ",leftmargin=0,topmargin=0");
}

function MAJAX() {
  var majax = false;
  // IE(5.0+)
  try {
     majax = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try { majax = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { majax = false; }
  }
  // Mozilla - Safari
  if( !majax && typeof XMLHttpRequest != 'undefined' ) {
    try { majax = new XMLHttpRequest(); } catch(e) { majax = false; }
  }
  // Diger (IceBrowser)
  if( !majax && window.createRequest ) {
    try { majax = window.createRequest(); } catch(e) { majax = false; }
  }
  return majax;
}

function mjxPost(yukle, yeri, nrd, gnd) {
  majax = new MAJAX();
  if( majax ) { majax.onreadystatechange = function () {}; majax.abort(); }
  majax.onreadystatechange = function () {	ld(yukle, yeri) }
  majax.open('POST', nrd, true)
  majax.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT")
  majax.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=iso-8859-9')
  majax.setRequestHeader("Content-length", gnd.length)
  majax.setRequestHeader("Connection", "close")
  majax.send(gnd)
}

function mjxGet(yukle, yeri, nrd, gnd) {
  majax = new MAJAX();
  if( majax ) { majax.onreadystatechange = function () {}; majax.abort(); }
  if(gnd) { nrd = nrd +'?'+ gnd; }
  majax.onreadystatechange = function () {	ld(yukle, yeri); }
  majax.open('GET', nrd, true);
  majax.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
  majax.setRequestHeader("Connection", "close");
  majax.send(null);
}

function ld(yukle, yeri) {
  if( yukle == 1 && yeri != 'id_yok' ) {
    if( majax.readyState == 1 || majax.readyState == 2 || majax.readyState == 3 ) {
      var yukleme = '<img src="loading.gif" width="16" height="16" alt="Yükleniyor ..." />'
      document.getElementById(yeri).innerHTML = yukleme;
    }
  }
  if( majax.readyState == 4 && yeri != 'id_yok' ) {
    if (majax.status == 200) { document.getElementById(yeri).innerHTML = majax.responseText; }
    else { document.getElementById(yeri).innerHTML = '<strong>Uyarı:</strong> ' + majax.statusText; }
    function MAJAX() {};
  }
}

function chrTemizle(text) {
  var yazi;
  yazi = encodeURIComponent(text);
  return yazi;
}
function yenile() { 
  window.opener.location.href = window.opener.location.href; 
  if(window.opener.progressWindow) { window.opener.progressWindow.close() }
  window.close();
}

function linkac(sc,lnk){
 if(sc != 'null'){window.open(lnk+sc,'_self');}
}

