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";

/* 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 setHomePage2(ths, url) {
	ths.style.behavior='url(#default#homepage)';
	ths.setHomePage(url);
}

/* Manşet Göster */

function getCuff(index)
	{
		var n = 10;
		for(i=0 ; i<n ; i++)
		{
			
			if(i == index)
			{
				menuid="image"+i;
				document.getElementById(menuid).style.display = "block";
				menuid="spot"+i;
				document.getElementById(menuid).style.display = "block";
			}
			else
			{
				menuid="image"+i;
				document.getElementById(menuid).style.display = "none";
				menuid="spot"+i;
				document.getElementById(menuid).style.display = "none";
				}
		}
}
_ZINDEX = 2000;
/* Banner Kodu */
function getBannerSWF(_WIDTH, _HEIGHT, _SRC)
{
	document.write('<div style="width: ' + _WIDTH + '; height: ' + _HEIGHT + '; z-index: ' + _ZINDEX + ';">');
	document.write('<object width="' + _WIDTH + '" height="' + _HEIGHT + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">');
	document.write('<param name="movie" value="' + _SRC + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="opaque">');
	document.write('<param name="scale" value="1">');
	document.write('<embed style="z-index: ' + _ZINDEX + ';" src="' + _SRC + '" width="' + _WIDTH + '" height="' + _HEIGHT + '" scale="exactfit" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>');
	document.write('</object>');
	document.write('</div>');
	_ZINDEX += 1;
}

/* 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;
}

/* Yazı 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 - 520) / 2;
	var wint = (screen.height - 390) / 2;
	window.open(href, target, 'width=520, height=390, 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 = "./yazar.php?nid=" + 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 envanter(){
   if (this.name!='fullscreen')
   { 
    window.open("http://www.sirnaksm.gov.tr/envanter/giris.aspx", "fullscreen", "menubar=no,statusbar=no,scrollbars=yes,resizable=no,left=0,top=0,width=832,height=597");
   }
     }  
    
  
     
     function tsm() 
{
msg=window.open("","msg","height=140,width=450");
msg.document.write("<html><title>TSM Bilgi Sistemi</title>");
msg.document.write("<body bgcolor='Wheat' onblur=window.close()>");
msg.document.write("<justify><a href='http://www.sirnaksm.gov.tr/tsm/tsmuygulama.exe'><b>-TSM Bilgi Sistemi Programını indirmek için tıklayın</b></a> </center>");
msg.document.write("<justify><a href='http://www.sirnaksm.gov.tr/indir/TSM_YARDIM.htm' target='_blank'><b>-YARDIM</b></a> </center>");
msg.document.write("<justify><a href='http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=tr&SrcCategoryId=&SrcFamilyId=0856eacb-4362-4b0d-8edd-aab15c5e04f5&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f5%2f6%2f7%2f567758a3-759e-473e-bf8f-52154438565a%2fdotnetfx.exe' target='_blank'><b>-TSM Bilgi Sistemi Programının Çalışması İçin Gerekli Program</b></a> </center>");
msg.document.write("<center><b>Programı kurmadan önce YARDIM dosyasını mutlaka okuyunuz</b> </center>");
//-- Ekleyecekleriniz bitmedi ise yukarıdaki diziyi aynen takip etmelisiniz
msg.document.write("<center><FORM> <INPUT TYPE=BUTTON VALUE=Kapat NAME=lowerButton onClick=self.close()> </FORM></center>");
msg.document.write("</body></html><p>");
}


    

 function eposta()
	{
	if (this.name!='mailscreen')
     		{ 
    	window.open("https://mail.sirnaksm.gov.tr/owa", "mailscreen", "menubar=no,statusbar=no,scrollbars=yes,resizable=yes,left=0,top=0,width=750,height=550");
     		}  
	}
	 function kalite(kaliteurl)
     { 
    window.open("http://www.sirnaksm.gov.tr/images/kalitesmp1.jpg", "fullscreen", "menubar=no,statusbar=no,scrollbars=yes,resizable=no,left=0,top=0,width=900,height=650");
   
     }  
     
      function asi(asiurl)
     { 
    window.open("http://www.ism.gov.tr/asitakvimi.aspx", "fullscreen", "menubar=no,statusbar=no,scrollbars=no,resizable=no,left=0,top=0,width=1000,height=710");
   
     }  

      function kusgribi(kusgribiurl)
     { 
    window.open("http://www.grip.saglik.gov.tr/", "fullscreen", "menubar=no,statusbar=no,scrollbars=yes,resizable=no,left=0,top=0,width=880,height=610");
       }      
      function domuzgribi(domuzgribiurl)
     { 
    window.open("http://www.grip.gov.tr/index.php?option=com_content&view=section&layout=blog&id=19&Itemid=527", "fullscreen", "menubar=no,statusbar=no,scrollbars=yes,resizable=no,left=0,top=0,width=880,height=610");
       }      
      function kirimkongo(kirimkongourl)
     { 
    window.open("http://www.kirim-kongo.saglik.gov.tr/", "fullscreen", "menubar=no,statusbar=no,scrollbars=yes,resizable=no,left=0,top=0,width=990,height=610");
   
     } 
      function sabem(sabemurl)
     { 
    window.open("http://www.sabem.saglik.gov.tr/", "fullscreen", "menubar=no,statusbar=no,scrollbars=yes,resizable=no,left=0,top=0,width=1020,height=610");
   
     } 
      function icd10(icd10url)
     { 
    window.open("http://www.saglik.gov.tr/ICD10/", "fullscreen", "menubar=no,statusbar=no,scrollbars=yes,resizable=no,left=0,top=0,width=990,height=610");
   
     } 
      function havanikoru(havanikoruurl)
     { 
    window.open("http://www.havanikoru.org.tr/", "fullscreen", "menubar=no,statusbar=no,scrollbars=yes,resizable=no,left=0,top=0,width=970,height=610");
   
     } 
