/*Cum Eki  3 04:29:29 EEST 2008
*/

function referanslariKontrolEt(referanslar){
    var referanslar = referanslar.split(',');
    referanslar.each(function (ref){
	tmp=$('riskdegerlendirme_nedenler_listesi'+ref);
	if(tmp)
	    tmp.addClass('kirmizi');
    });
}
function referanslarinKontrolünüIptalEt(){
    $$('.kirmizi').each(function (item){item.removeClass('kirmizi')})
}
function i_goster(goster){
    for(i=0;i<10;i++){
	if(saklanacak_icerik = document.getElementById('ilan_sayfasi_icerik'+i))
	    saklanacak_icerik.className = 'hide';
	if(saklanacak_icerik = document.getElementById('isi_'+i))
	    saklanacak_icerik.className = 'hide';
    }
    document.getElementById('ilan_sayfasi_icerik'+goster).className	= 'show';
    document.getElementById('isi_'+goster).className	= 'show';
}
function gED(d,h,m){var exd= new Date(); exd.setDate(exd.getDate()+parseInt(d));exd.setHours(exd.getHours()+parseInt(h));exd.setMinutes(exd.getMinutes()+parseInt(m));return exd.toGMTString();}
function gC(ofs){ var estr=document.cookie.indexOf(';',ofs);if(estr==-1)estr=document.cookie.length; return unescape(document.cookie.substring(ofs,estr));
}
function getCookie(n){
var arg=n+'=';var alen=arg.length; var clen=document.cookie.length;var i=0;
while(i<clen){j=i+alen;if(document.cookie.substring(i,j)==arg){return gC(j);}
i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}return "";
}
function setCookie(n,v,p,e){
document.cookie=n+'='+escape(v)+((p)?'; path='+p:'')+((e)?'; expires='+e:'');
return false;
}
function gecikmeliFonksiyonCalistir(fn){
    if(window.gecikmeliFonksiyonCalistirtime)
	clearTimeout(gecikmeliFonksiyonCalistirtime);
    gecikmeliFonksiyonCalistirtime=setTimeout(fn,500);
}
function valuedanSec(select, value){
    for(i=0;i<select.options.length;i++){
        if(select.options[i].value==value)
            select.selectedIndex=i;
    }
}
function valuedanSec2(select, value){
    for(i=0;i<select.options.length;i++){
        if(select.options[i].text==value)
            select.selectedIndex=i;
    }
}
function ResimYoksa(that){
    if(that.src!='http://resimleri.web.tr/yok.gif')
	that.src='http://resimleri.web.tr/yok.gif';
}
function resimEkleLinkiYarat(that){
    var tr = fey('tr',that.parentNode.parentNode.parentNode);
    var td = fey('td',tr);
    var input	= fey('input', td);
    input.name	= 'resim[]';
    input.type	= 'file';
}
function inputSil(nerden){ if(nerden.value==nerden.defaultValue)nerden.value=''; }
function inputYaz(nerden){ if(nerden.value=='')nerden.value=nerden.defaultValue; }
function tinyMCE_Islevsellestir(txtArea,button){
    tinyMCE.execCommand('mceAddControl', false, txtArea);
    button.onclick=function(){return tinyMCE_Islevsellestirme(txtArea, button);};
    button.value='Editörü kaldır';
    return false;
}

function tinyMCE_Islevsellestirme(txtArea, button){
    tinyMCE.execCommand('mceRemoveControl', false, txtArea);
    button.onclick=function(){return tinyMCE_Islevsellestir(txtArea, button);};
    button.value='Editör getir';
    return false;
}

    function fey(ney, neye){
        var tmp = document.createElement(ney);
        neye.appendChild(tmp);
        return tmp;
    }
    function formYap(ney,name,kendiIdsi){
        var tmp=document.createElement('form');
        tmp.className='docArch_form';
        tmp.method='get';
        var tmp2=document.createElement('h2');
        tmp2.appendChild(document.createTextNode(name));
        tmp.appendChild(tmp2);
        var tmp2=document.createElement('input');
        tmp2.setAttribute('type','hidden');
        tmp2.value=ney;
        tmp2.name='task'
        tmp.appendChild(tmp2);
	    var tmp2=document.createElement('input');
		tmp2.setAttribute('type','hidden');
		tmp2.setAttribute('name','kendiIdsi');
		tmp2.value=kendiIdsi;
        tmp.appendChild(tmp2);
        var tmp2=document.createElement('input');
        tmp2.setAttribute('type','hidden');
        tmp2.value='com_docarch';
        tmp2.name='option'
        tmp.appendChild(tmp2);
        return tmp;
    }
    function activate_slimbox(){
    }
    function sonuna_ekle(elem, eklenecek){
    	elems=document.getElementsByName(elem);
    	for(i=0;i<elems.length;i++)
	    elems[i].value = eklenecek;
	return false;
    }

    function select_from_array(arr, val, index){
	if(!index)
		index =0;
	for(i=0;i<arr.length;i++){
	    if(arr[i][index]==val)
	    return arr[i];
	}
	return false;
    }
    function setFocus(elem){
	elem	=	document.getElementById(elem);
	elem.style.display	=	'block';
	elem.focus();
    }
    menu_status = new Array();
    function showHide(theid) {
	if (document.getElementById) {
	    var switch_id = document.getElementById(theid);

	    if (menu_status[theid] != 'show') {
		switch_id.className = 'show';
		menu_status[theid] = 'show';
	    } else {
		switch_id.className = 'hide';
		menu_status[theid] = 'hide';
	    }
	}
    }
/*
function initFaders(){
    $('dhonis').childEle
}
function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
    }
  }
}
function fadeOut(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity >= 0) {
      setOpacity(obj, opacity);
      opacity -= 10;
      window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 100);
    }
  }
}
function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;

  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";

  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;

  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;

  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

*/