// JavaScript Document
function Highlight(element,basla,bitir){ // ----	------	------	------	Highligh EFEKTI
	if (!(basla)) basla = "#FF6";
	if (!(bitir)) bitir = "none";

	element.style.cursor='pointer'; 
	element.style.background = basla;
	element.onmouseout = function(){element.style.background = bitir;};
}


function HighlightEffect(element,basla,bitir,sure){ // ----	------	------	------	Highligh EFEKTİ
	if (!(basla)) basla = "#E874BF";
	if (!(bitir)) bitir = "#FFFFFF";
	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 = "#FFCFEE";
	$(element).style.cursor='pointer'; 
}
function HighlightDOWN(element,renk){ // ------	------	------	------	SARI SÖNMESİ
	if (!(renk)) basla = "none";
	$(element).style.background = basla;
	$(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 gizle(element){ // ------	------	------	------	------	ELEMENTİ Gizle
	$(element).style.visibility = 'hidden';
}
function goster(element){ // ------	------	------	------	------	ELEMENTİ Göster
	$(element).style.visibility = 'visible';
}
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 addLoadEvent(func)
{
  var oldonload = window.onload;
  if (typeof window.onload != 'function')
  {
    window.onload = func;
  }
  else
  {
	window.onload = function()
	{
      if (oldonload)
	  {
        oldonload();
      }
      func();
    }
  }
}


function selectCode(a)
{
	// Get ID of code block
	var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];

	// Not IE
	if (window.getSelection)
	{
		var s = window.getSelection();
		// Safari
		if (s.setBaseAndExtent)
		{
			s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
		}
		// Firefox and Opera
		else
		{
			// workaround for bug # 42885
			if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
			{
				e.innerHTML = e.innerHTML + '&nbsp;';
			}

			var r = document.createRange();
			r.selectNodeContents(e);
			s.removeAllRanges();
			s.addRange(r);
		}
	}
	// Some older browsers
	else if (document.getSelection)
	{
		var s = document.getSelection();
		var r = document.createRange();
		r.selectNodeContents(e);
		s.removeAllRanges();
		s.addRange(r);
	}
	// IE
	else if (document.selection)
	{
		var r = document.body.createTextRange();
		r.moveToElementText(e);
		r.select();
	}
}

function StyleFlip(elementName,renkBG,renkFont)
{ 
	document.getElementById(elementName).style.background = renkBG;   
	document.getElementById(elementName).style.color =  renkFont;   
	window.setTimeout("StyleFlop('"+elementName+"','"+renkBG+"','"+renkFont+"')",500);  
}
function StyleFlop(elementName,renkBG,renkFont)
{
	document.getElementById(elementName).style.background = "none";
	document.getElementById(elementName).style.color = "#000";
	window.setTimeout("StyleFlip('"+elementName+"','"+renkBG+"','"+renkFont+"')",500);
}
