// JavaScript Document
function HighlightEffect(element,basla,bitir,sure){ // ----	------	------	------	Highligh EFEKTİ
	if (!(basla)) basla = "#FFFFCC";
	if (!(bitir)) bitir = "#ebf2f6";
	if (!(sure)) sure = 3;
   new Effect.Highlight(element, 
				  {
					startcolor: basla,//"#FFFFCC",
					endcolor: bitir,//"#ebf2f6",
					restorecolor: bitir,//"#ebf2f6",
					duration: sure
				  });
	try{
		element.style.cursor='pointer'; 
	}catch(err){
	}
}

//=================================================================================================>>

function HighlightUP(element){ // ------	------	------	------	SARI YANMASI
	$(element).style.background = "#CCF";
	$(element).style.cursor='pointer'; 
}
function HighlightDOWN(element){ // ------	------	------	------	SARI SÖNMESİ
	$(element).style.background = 'none';
	$(element).style.cursor='pointer'; 
}

//=================================================================================================>>

function flu(element,miktar){ // --------	------	------	------	BLUR VERME
	element.filters.blur.strength = miktar;
	element.style.filter = 'blur(strength=' + miktar + ')';
}
function fligran(element,miktar){ // --------	------	------	------	BLUR VERME
	element.style.opacity = miktar;
	element.style.filter = 'alpha(opacity=' + miktar + ')';
}

//=================================================================================================>>

function ac(element){ // ------	------	------	------	------	ELEMENTİ AÇMA
	$(element).style.display = 'block';
}
function kapa(element){ // ------	------	------	------	------	ELEMENTİ KAPAMA
	$(element).style.display = 'none';
}
function ackapa(element){ // ------	------	------	------	------	ELEMENTI AÇMA
	if ($(element).style.display == 'none' ) $(element).style.display = 'block';
	else if ($(element).style.display == 'block' ) $(element).style.display = 'none';
}

//=================================================================================================>>

function aktif(element){ 
	$(element).disabled = false;
}
function pasif(element){ 
	$(element).disabled = true;
}
function aktifpasif(element){ 
	//alert("ss : "+element + "-" + $(element).disabled);
	if ($(element).disabled) $(element).disabled = false;
	else $(element).disabled = true;
}

//=================================================================================================>>

function gizle(element){ // ------	------	------	------	------	ELEMENTİ Gizle
	$(element).style.visibility = 'hidden';
}
function goster(element){ // ------	------	------	------	------	ELEMENTİ Göster
	$(element).style.visibility = 'visible';
}
function gizlegoster(element){ // ------	------	------	------	------	ELEMENTI Gizle veya Göster
	if ($(element).style.visibility == 'hidden' ) $(element).style.visibility = 'visible';
	else if ($(element).style.visibility == 'visible' ) $(element).style.visibility = 'hidden';
}

//=================================================================================================>>

function PopsayfaAc(url,name,w,h) 
{ 
//	alert(url+" "+name+" "+w+" "+h);
   newwindow=window.open(url,name,'height='+h+',width='+w+',toolbar=0,location=0,directories=0,status=0,MenuBar=0,scrollbars=0,resizable=0'); 
   if (window.focus) {newwindow.focus()} 
} 
function bookmarksite(title, url){
	if (document.all)
	window.external.AddFavorite(url, title);
	else if (window.sidebar)
	window.sidebar.addPanel(title, url, "")
}

function TCKimlikDogrula(TCKimlikNo) 
{
	if((TCKimlikNo).length == 11)
	{
		T1 = TCKimlikNo.substr(0,1)*1;
		T2 = TCKimlikNo.substr(1,1)*1;
		T3 = TCKimlikNo.substr(2,1)*1;
		T4 = TCKimlikNo.substr(3,1)*1;
		T5 = TCKimlikNo.substr(4,1)*1;
		T6 = TCKimlikNo.substr(5,1)*1;
		T7 = TCKimlikNo.substr(6,1)*1;
		T8 = TCKimlikNo.substr(7,1)*1;
		T9 = TCKimlikNo.substr(8,1)*1;
		Alg1 = (10-((T1+T3+T5+T7+T9)*3+(T2+T4+T6+T8))%10)%10;
		Alg2 = (10-((T2+T4+T6+T8+Alg1)*3+(T1+T3+T5+T7+T9))%10)%10;
		/*
		alert (T1+'-'+T2+'-'+T3+'-'+T4+'-'+T5+'-'+T6+'-'+T7+'-'+T8+'-'+T9);
		alert (Alg1+'-'+Alg2);
		*/
		if (Alg1 == TCKimlikNo.substr(9,1) && Alg2 == TCKimlikNo.substr(10,1))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	else
	{
		return false;
	}
}

function addLoadEvent(func)
{
  var oldonload = window.onload;
  if (typeof window.onload != 'function')
  {
    window.onload = func;
  }
  else
  {
	window.onload = function()
	{
      if (oldonload)
	  {
        oldonload();
      }
      func();
    }
  }
}
function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}