var user_agent = navigator.userAgent;

var isOpera = user_agent.indexOf("Opera") >= 0;

var isFirefox = user_agent.indexOf("Firefox") >= 0;

var isWin32up = user_agent.indexOf("Win32") >= 0 

	|| user_agent.indexOf("Win64") >= 0

	|| user_agent.indexOf("Windows NT") >= 0;



var isIE = !isOpera && user_agent.indexOf("MSIE") >= 0;

var isIE55up = isIE && isWin32up && user_agent.match(/MSIE ((5\.5)|[6789])/);

var isIE70up = isIE && isWin32up && user_agent.match(/MSIE ([789])/);

var isIE55dn = isIE && !isIE55up;

var browser = "other";

/* PNG Resimleri düzgün Göster */
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

if ((version >= 5.5) && (document.body.filters))
{
   for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
         img.outerHTML = strNewHTML
         i = i-1
      }
   }
}



/* Site Ana Sayfam Yap & Favorilerime Ekle */


function add2Favorites(ths, url, title) {

	if (isIE && window.external != null) {

		window.external.AddFavorite(url,title);

	} else if (isFirefox && window.sidebar && window.sidebar.addPanel) {

		window.sidebar.addPanel(title, url, '');

	} else if (isOpera) {

		ths.rel = "sidebar";

		ths.title = title

		ths.href = url;

	}

}

function pencereac(adres,genis,yuksek) {

  if (document.all)
  {
  var genislikYap = genis;
  var genislikArtir = 3;
  var yukseklikYap = yuksek;
  var yukseklikArtir = 3;
  
  var yeniPencere = window.open("","yorumekle","left=200,top=100,width=1,height =1,scrollbars=0");
  for (yukseklik = 1; yukseklik < yukseklikYap; yukseklik += yukseklikArtir)
  {
  yeniPencere.resizeTo("1", yukseklik);
  }
  for (genislik = 1; genislik < genislikYap; genislik += genislikArtir)
  {
  yeniPencere.resizeTo(genislik, yukseklik);
  }
  
  yeniPencere.location = adres;
  }
  else
  window.location = adres;
}

function setHomePage2(ths, url) {

	ths.style.behavior='url(#default#homepage)';

	ths.setHomePage(url);

}


/* Textarea Yazı Limiti */

function validateLength(el, word_left_field, len)

{

	document.all[word_left_field].value = len - el.value.length;

	if(document.all[word_left_field].value < 1)

	{

		alert("En Fazla " + len + " karakter girebilirsiniz.");

		el.value = el.value.substr(0, len);

		document.all[word_left_field].value = 0;

		return false;

	}

	return true;

}



/* Yazy Boyutu De?i?tir */



function changeSize(elm, _size, class_name)

{

	document.getElementById(elm).className = class_name + ' ' + class_name + '_' + _size;

}



/**/



function changeTarget(elm)

{

	tmp = elm.getElementsByTagName("a");

	for(i=0; i<tmp.length; i++)

		tmp[i].target = "_blank";

}



/**/



function openPopUp_520x390(href, target)

{

	var winl = (screen.width - 550) / 2;

	var wint = (screen.height - 550) / 2;

	window.open(href, target, 'width=550, height=550, top=' + wint + ', left=' + winl + ', toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');

	return false;

}



/**/



function openPopUp(href, target)

{

	var winl = (screen.width - 600) / 2;

	var wint = (screen.height - 450) / 2;

	window.open(href, target, 'width=600, height=450, top=' + wint + ', left=' + winl + ', toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');

	return false;

}



/**/



function userPopup(href, target, width, height)

{

	var winl = (screen.width - width) / 2;

	var wint = (screen.height - height) / 2;

	window.open(href, target, 'width = '+width+', height=' + height +', top=' + wint + ',left=' + winl + ', toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');

	return false;

}



/**/



function goPage(idx)

{

	return window.location = "./page_detail.php?page_id=" + idx;

}



/**/



function changeArticle(idx)

{

	return window.location = "./author_article_detail.php?article_id=" + idx;

}



/**/



function blinkIt()

{

	if(!document.all)

		return;

	else

	{

		for(i=0; i<document.all.tags('blink').length; i++)

		{

			s=document.all.tags('blink')[i];

			s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';

		}

	}

}





function getSWF(swWidth, swHeight, swFile, swWmode)

{

	var str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width='+swWidth+'  height='+swHeight+'>';

	str += ' <param name="movie" value="'+swFile+'" /> ';

	str += ' <param name="quality" value="high" /> ';

	str += ' <param name="wmode" value="'+swWmode+'" /> ';

	str += ' <embed src='+swFile+' width='+swWidth+' height='+swHeight+' quality="high" pluginspage="http://www .macromedia.com/go/getflashplayer" type="application/x-shoc kwave-flash" wmode="transparent"></embed> ';

	str += ' </object> ';

	document.write(str);

}

function SymError()

{

	return true;

}

function EpostaKontrol(string) {
  if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
    return true;
  else
  return false;
}

function printit(){  

if (isIE) {

    window.print() ;  

} else {

    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';

document.body.insertAdjacentHTML('beforeEnd', WebBrowser);

    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  

}

}
