function urlEncode(str) { 
    return encodeURI(str);
} 

function OpenPopup(url, name, features) {
   window.open(url, name, features, false);
   }

function PopUp()
{
window.open("popup.html","CustomPopUp","width=600, height=800, left=10, top = 10, menubar=no, resizable=yes,scrollbars=yes",false);
				
}
function PopUp2()
{
window.open("UYARILAR/NASILYUKLERIM.htm","CustomPopUp2","width=600, height=800, left=80, top = 40, menubar=no, resizable=yes,scrollbars=yes",false);
				
}
function PopUp3()
{
window.open("kimlik/duyuru.htm","CustomPopUp2","width=800, height=400, left=40, top = 40, menubar=no, resizable=yes,scrollbars=yes",false);
				
}


function OpenImageSelect(){
     var features = 'menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,width=800,height=400';
     var url = 'popUpResimList.aspx';
    newwindow=window.open('popUpResimList.aspx','name','menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,height=200,width=150');
	if (window.focus) {newwindow.focus();}
	return false;
}

function findIData(id)
{
    if(document.getElementById("findID")!=null)
	  document.getElementById("findID").value=id;
	  //__doPostBack('navBar:KAYITSIL','')
	  //alert(id);
	  __doPostBack('navBar:navid','');    
          //__doPostBack('navBar:navid','');          	        
}
function HideLeftCol()
{
	strOldCols = parent.frames.colums.cols;
//	alert(strOldCols);
	if (parent.frames.colums.cols=="0,*")
	{
		parent.frames.colums.cols = "240,*";
	}
	else
	{
		parent.frames.colums.cols = "0,*";
	}
				
    //alert('asdsa');
	//window.parent.frames('Content').window.location.reload();
	//window.parent.frames('contents').cols = "0,*";
	
	//parent.frames.colums.cols = strOldCols;
}
				

function OpenSearch(params){
     var features = "menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,width=800,height=400"
     var url = "/SearchList.aspx?"+params;
     OpenPopup(url,"SearchWindow", features);
}


function focuscontrol()
{
    if(document.getElementById(document.getElementById("activefield").value)!=null)
    {
        if (document.getElementById(document.getElementById("activefield").value)!=null)
        {
            document.getElementById(document.getElementById("activefield").value).focus();
            if(document.getElementById(document.getElementById("activefield").value).tagName=="INPUT")
                document.getElementById(document.getElementById("activefield").value).select();
        }
    }
    document.body.leftMargin=1;
    document.body.topMargin=1;
}


function listele(){
	
if(document.getElementById("dnlistele")!=null)
	{
            srchtype = 2;
            var url = document.getElementById("dnlistele").value;
            OpenSearch(urlEncode(url));
	} 

}

function getObjInnerText(obj){
  if (document.all) { // IE;
    return obj.innerText;
  }
  else{
    if (obj.textContent)
    {
      return obj.textContent; 
    }
    else
      alert("Error: This application does not support your browser.  Try again using IE or Firefox.");
  }
}

function SendDataBack(form, rVal, lNo, fldCount) {

           var ret = new Array(fldCount); 
                      
           ret[0] = rVal;
      
           for(ii = 1; ii < fldCount; ii++) {
          
                ret[ii] = getObjInnerText(document.getElementById("R." + lNo + "." + ii));
               
           }

   if(document.getElementById("_tablename")!=null&&document.getElementById("_tablename").value=="VLST")
           {		 		
	  window.opener.document.getElementById("dnid").value=ret[0];
          window.opener.__doPostBack('navBar:navid','');
          window.close();
	         
	  }
           else
           {
		window.opener.SetWindowControls(ret);
	   }


           window.close();


}
function sec(tablek)
{

	  document.getElementById("dnid").value=tablek;
          __doPostBack('navBar:navid','');          	        
}
function sil()
{
if(!confirm("KAYIT Silinsin mi?"))
return;
else
__doPostBack('navBar:KAYITSIL','')
}




function ilkKayit()
{
if(window.parent.frames('AppContent').document.getElementById("dnid")!=null)
	window.parent.frames('AppContent').__doPostBack('navBar:FIRSTRECORD','');
}

/****modal rapor uyarıcı***/

function showPopUp(el) 
{
    var cvr = document.getElementById("cover");
    var dlg = document.getElementById(el);
    cvr.style.display = "block";
    dlg.style.display = "block";
    if (document.body.style.overflow = "hidden") 
    {
        cvr.style.width = "100%";
        cvr.style.height = "100%";
    }
}

function closePopUp(el) 
{
        var cvr = document.getElementById("cover");
        var dlg = document.getElementById(el);
        cvr.style.display = "none";
        dlg.style.display = "none";
        document.body.style.overflowY = "scroll";
}
