var tarayici= navigator.appName;

function tubip_sifre_degistir()
{
         var frm = document.admin_sifre_form;        

     if (frm.EskiSifre.value.length < 6)
     {   
            alert('LÜtfen eski Şifrenizi giriniz');
            return;
     }
     
     if (frm.YeniSifre.value.length < 6 && frm.YeniSifreTekrar.value.length < 6)
     {   
            alert('Yeni Şifreniz en az 6 karakter olmalı!');
            return;
     }
     
     if (frm.YeniSifre.value != frm.YeniSifreTekrar.value)
     {   
            alert('Yeni Şifreniz ile yeni Şifre tekrarı uyuşmuyor!');
            return;
     }
     
     frm.submit();       
     
}

function tubip_link_kontrol()
{
         var frm = document.bolum_form;		

	 if (frm.LinkType.selectedIndex != 2)
	 {   
	 	frm.Url.value = "";
	 	frm.Url.disabled = true;
	 }	
	 else
	    frm.Url.disabled = false;
}


function tubip_dosya_sil(Obj)
{
    var frm = Obj.form;
    
    if (confirm('\"'+frm.DosyaName.value+'\" isimli dosyayı silmek istediğinize eminmisiniz?'))
    	frm.submit();
    else
    	return;	
}

function tubip_bolum_adi_esitle()
{
   var frm = document.bolum_form;
   
   if (frm.BolumBasligi.value > 0 )
   {
       if (frm.hIslemTuru.value == 2 )
            eval("frm.BolumName.value = frm.B"+frm.BolumBasligi.value+".value");
       
       else if (frm.hIslemTuru.value == 3 )
       {     
            eval("frm.LinkType.selectedIndex = frm.LT"+frm.BolumBasligi.value+".value; if (frm.LT"+frm.BolumBasligi.value+".value == 2) frm.Url.disabled=false;");
            eval("frm.Url.value = frm.L"+frm.BolumBasligi.value+".value");
       }

       	document.getElementById('Url2').innerHTML = 'http://www.tubiptech.tubip.edu.tr/index.php?Lang='+frm.hDil.value+'&Bid='+frm.BolumBasligi.value+'&Bbid='+frm.hBolumNumber.value;     

}   
}

function tubip_link_ekle()
{
	var frm = document.bolum_form;
	tubip_secili_dosya_ekle('http://www.tubiptech.tubip.edu.tr/index.php?Lang='+frm.hDil.value+'&Bid='+frm.BolumBasligi.value+'&Bbid='+frm.hBolumNumber.value);
}

function tubip_secili_dosya_ekle(fileUrl)
{
	//window.top.opener.tinyMCE.insertImage(fileUrl, '', '', '', '', '', '', '');	
	window.top.opener.Linkle(fileUrl);	
	window.top.close() ;
	window.top.opener.focus() ;
}	

function tubip_bolum_basligi_ekle()
{

	 var frm = document.bolum_form;		

     if (frm.hUpdate.value != '1')
     {
		if (frm.hDil.value.length < 2)
		{   
			alert("Lütfen dil se�imini yap�n�z");
			return;	
		}
		
		if (frm.hAnaBolum.value < 1)
		{   
			alert("L�tfen ana b�l�m se�imini yap�n�z");
			return;	
		}	
		
		
		if (frm.BolumName.value.length < 2)
		{   
			alert("L�tfen yeni b�l�m ba�l��� alan�n� doldurunuz");
			return;	
		} 
	 }
	 
	 frm.submit();
	 
}

function tubip_site_icerigi_duzenle()
{

	 var frm = document.bolum_form;		

	 if (frm.hDil.value.length < 2)
	 {   
		alert("L�tfen dil se�imini yap�n�z");
		return;	
	 }
	 
	 if (frm.hAnaBolum.value < 1)
	 {   
		alert("L�tfen ana b�l�m se�imini yap�n�z");
		return;	
	 }	
	 
	 if (frm.BolumBasligi.selectedIndex < 1)
	 {   
		alert("L�tfen b�l�m ba�l���n� se�iniz");
		return;	
	 }		 	
	 
	 frm.submit();
	 
}

function tubip_dosya_ekle()
{
	var frm=document.dosya_form;
	
	if (frm.Dosya1.value.length < 5  && frm.Dosya2.value.length < 5 && frm.Dosya3.value.length < 5 && frm.Dosya4.value.length < 5 && frm.Dosya5.value.length < 5)
	
	alert("L�tfen en az 1 dosya ekleyiniz");
	
	else
	frm.submit();

}


var popUpWin=0;

function tubip_open_windows(URLStr,sayfaname,left,top,width,height)
{
  
if(popUpWin)
  {
  	var tarayici= navigator.appName

    if(!popUpWin.closed){

	if (tarayici=="Netscape") 
	popUpWin.close();
	if (tarayici=="Microsoft Internet Explorer") 
	popUpWin.Close();
	
    }
     
  }
  popUpWin = open(URLStr, sayfaname,'scrollbars=yes,width='+width+',height='+height+',left='+left+', top='+top+'screenX='+left+',screenY='+top+'');

}

function MM_swapImgRestore() 
{
  	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) 
{ 
  
  var p,i,x;  
    
  if(!d)
  
  d=document; 
  
  if((p=n.indexOf("?"))>0&&parent.frames.length)
  {
  	d=parent.frames[n.substring(p+1)].document; 
  	n=n.substring(0,p);
  }
  
  if(!(x=d[n])&&d.all) 
  
    x=d.all[n]; 
  	
  	for (i=0;!x&&i<d.forms.length;i++) 
  	
  	    x=d.forms[i][n];
  	    
  		for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
  		
		  x=MM_findObj(n,d.layers[i].document);
		  
  			if(!x && d.getElementById) 
  			
		  	x=d.getElementById(n); 
		  	
		return x;
}

function MM_swapImage()
{ 
 	var i,j=0,x,a=MM_swapImage.arguments;
  
  	document.MM_sr=new Array; 
  	
	for(i=0;i<(a.length-2);i+=3)
	
	if ((x=MM_findObj(a[i]))!=null)
	{
		document.MM_sr[j++]=x; 
		
		if(!x.oSrc) 
		x.oSrc=x.src; 
		x.src=a[i+2];
	}
}

function menubarOvr(src)
{ 
	var tarayici= navigator.appName
	src.className="MenuBarOver";		
	if (tarayici=="Netscape") 
	src.style.cursor="pointer";
	if (tarayici=="Microsoft Internet Explorer") 
	src.style.cursor="hand";
}

function menubarOut(src)
{ 
	src.className="MenuBar";
}

function tubip_gonder_gitsin(Url)
{
     document.location=Url;
}    
        
function tubip_combo_link(Adres,Obje,Secimli){
 	 eval(Adres+".location='"+Obje.options[Obje.selectedIndex].value+"'");
  if (Secimli) Obje.selectedIndex=0;
}