﻿//by erhant 14.08.2006 and emren 16.08.2006
// eger 2 dropdownbox'da ayni deger secili olursa uyari mesaji verip
// son atanan dropdown'in value'sunu 0'a resetliyor.
function checkDrpValue(drp)
{
	var allDrp = document.getElementsByTagName("select");
	var myDrp = document.getElementById(drp);
	var iCount = allDrp.length;

	for (i=0; i<iCount;i++)
	{
		if (allDrp[i] != myDrp)
		{
			if((allDrp[i].value == myDrp.value) && myDrp.value !=0)
			{
				alert ("Bu siralama degeri daha önce kullanildi. Lütfen baska bir deger seçiniz."); 
				myDrp.value =0;
			}				
		}
		
	}

	}
//by erhant 14.08.2006 and emren 16.08.2006
// eger 2 dropdownbox'da ayni deger secili olursa uyari mesaji verip
// son atanan dropdown'in value'sunu 0'a resetliyor.
//dropdown 0'dan baska bir value aldiginda ,dropdown'in 
// yanindaki  enabled'i false atanmis textboxlar
//  enabled oluyor. 
function checkDrpVal(drp)
{
	var allDrp = document.getElementsByTagName("select");
	var alltxt=document.getElementsByTagName("input");
	var myDrp = document.getElementById(drp);
	var iCount = allDrp.length;
	var textnumber=-1;
	var hasError = false;

	for (i=0; i<iCount;i++)
	{
		if (allDrp[i] != myDrp)
		{
			if((allDrp[i].value == myDrp.value) && myDrp.value !=0)
			{
				alert ("Bu siralama degeri daha önce kullanildi. Lütfen baska bir deger seçiniz.");
				myDrp.value =0;
				hasError=true;
			}				
		}
		if (allDrp[i] == myDrp)
		{
				textnumber=i;
		}
		
	}
    for(i=0;i<=textnumber;i++)
    {
    if(alltxt[i].type!="text")
         {
         textnumber++;
         }
    }
	if( hasError==false && textnumber>=0)
	{
	alltxt[textnumber].removeAttribute("disabled");
	}
	  
}
function selectGo(u) {
	if (u!='' && u!='#') {
		location.href=u;
	}
}
//by erhant for "yükleniyor"
function OpenDiv(divName)
{
		divName.style.display="block";
}
function CloseDiv(divName)
{
		divName.style.display="none";
}

//BY ERHANT URUN TANITIMI KULLANICI KLAVUZU GET FILE
function GetManual(selectname)
		{
			var adres;
			adres=document.all(selectname).value;			
			PopWin2(adres, 800, 600);
		}
		
function Browser() {
	var b=navigator.appName;
	if (b=="Netscape") this.b="ns";
	else if ((b=="Opera") || (navigator.userAgent.indexOf("Opera")>0)) this.b = "opera";
	else if (b=="Microsoft Internet Explorer") this.b="ie";
	if (!b) alert('Unidentified browser./nThis browser is not supported,');
	this.version=navigator.appVersion;
	this.v=parseInt(this.version);
	this.ns=(this.b=="ns" && this.v>=4);
	this.ns4=(this.b=="ns" && this.v==4);
	this.ns6=(this.b=="ns" && this.v==5);
	this.ie=(this.b=="ie" && this.v>=4);
	this.ie4=(this.version.indexOf('MSIE 4')>0);
	this.ie5=(this.version.indexOf('MSIE 5')>0);
	this.ie55=(this.version.indexOf('MSIE 5.5')>0);
	this.ie6=(this.version.indexOf('MSIE 6')>0);
	this.opera=(this.b=="opera");
	this.dom=(document.createElement && document.appendChild && document.getElementsByTagName)?true:false;
	this.def=(this.ie||this.dom); // most used browsers, for faster if loops
	var ua=navigator.userAgent.toLowerCase();
	if (ua.indexOf("win")>-1) this.platform="win32";
	else if (ua.indexOf("mac")>-1) this.platform="mac";
	else this.platform="other";
}
is = new Browser();

	
 function popup(url,ww,wh,nm)
     {
        FWin = window.open(url,"YeniPencere","toolbar=0,top=20,left=20,width=" + ww + ",height=" + wh + ",location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0");
        //FWin.title = nm;
        FWin.focus();
      }
      
 function popupCenter(url,ww,wh,nm)
     {
        FWin = window.open(url,"YeniPencere","toolbar=0,top="+ (screen.height - wh)/2 +",left=" + (screen.width - ww)/2 + ",width=" + ww + ",height=" + wh + ",location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0");
        //FWin.title = nm;
        FWin.focus();
      }     
      
       function showpopup(url,ww,wh,nm)
     {
        FWin = window.open(url,nm,"toolbar=0,top=20,left=20,width=" + ww + ",height=" + wh + ",location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0");
        //FWin.title = nm;
        FWin.focus();
      }
	
	
 function popup2(url,ww,wh,nm)
     {
        FWin = window.open(url,"YeniPencere","toolbar=0,top=20,left=20,width=" + ww + ",height=" + wh + ",location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0");
        //FWin.title = nm;
        FWin.focus();
      }
	  
function PopWin2(url,p_width,p_height){
		KopWin = window.open("","","toolbar=0,width=" + p_width + ",height=" + p_height + ",location=0,directories=0,status=0,scrollbars=1,menubar=0,resizable=0,copyhistory=0"); 
		KopWin.location.href = url;
		KopWin.focus();
	}
	
function openPrint(url) {
		
		ww=600;
		wh=500;
        pvWin = window.open(url,"Talihli","toolbar=0,top=20,left=20,width=" + ww + ",height=" + wh + ",location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0");
        //FWin.title = nm;
        pvWin.focus();
      
}