function Browser(){
	var ua = navigator.userAgent.toLowerCase(); 
	this.Gecko = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
	this.Safari = (ua.indexOf('safari') != - 1);
	this.IE = (ua.indexOf('msie') != -1 && !this.Opera && (ua.indexOf('webtv') == -1) ); 
	this.Firefox = ( (ua.indexOf('firebird/') != -1) || (ua.indexOf('firefox/') != -1) );
	this.IECompatible = ( (ua.indexOf('msie') != -1) && !this.IE);
	this.NSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.NS && !this.Mozilla);
	this.geckoVersion = ( (this.Gecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
	this.equivalentMozilla = ( (this.Gecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
	this.versionMinor = parseFloat(navigator.appVersion); 
	if (this.Gecko && !this.Mozilla) this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
	else if (this.Mozilla) this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
	else if (this.IE && this.versionMinor >= 4) this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
	else if (this.Safari) this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
	this.versionMajor = parseInt(this.versionMinor); 
	this.DOM1 = (document.getElementById);
	this.DOM2Event = (document.addEventListener && document.removeEventListener);
	this.mode = document.compatMode ? document.compatMode : 'BackCompat';
	this.Win = (ua.indexOf('win') != -1);
	this.Mac = (ua.indexOf('mac') != -1);
	this.NS6up = (this.NS && this.versionMajor >= 6);
	this.NS7up = (this.NS && this.versionMajor >= 7);
	this.IE4 = (this.IE && this.versionMajor == 4);
	this.IE5 = (this.IE && this.versionMajor == 5);
	this.IE55 = (this.IE && this.versionMinor == 5.5);
	this.IE5up = (this.IE && this.versionMajor >= 5);
	this.IE6x = (this.IE && this.versionMajor == 6);
	this.IE6up = (this.IE && this.versionMajor >= 6);
}
var is = new Browser();

var flashVersion = 0;
function getFlashVersion() {
	var latestFlashVersion = 20;
	var agent = navigator.userAgent.toLowerCase(); 
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object'){ 
			for (var i = latestFlashVersion; i >= 3; i--){
	            if (flashPlugin.description.indexOf(i + '.') != -1){
	               flashVersion = i;
	               break;
	            }
			}
		}
	}
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
		var doc = '<scr' + 'ipt language="VBScript"\> \n';
		doc += 'On Error Resume Next \n';
		doc += 'Dim obFlash \n';
		doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
		doc += '	Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
		doc += '	If IsObject(obFlash) Then \n';
		doc += '		flashVersion = i \n';
		doc += '		Exit For \n';
		doc += '	End If \n';
		doc += 'Next \n';
		doc += '</scr' + 'ipt\> \n';
		document.write(doc);
	} else {flashVersion = flashVersion_DONTKNOW; }
return flashVersion;
}
var flashVersion_DONTKNOW = -1;
function FlashObject(){
	this.ID=this.ID;
	this.maxVersion=this.maxVersion;
	this.noFlashRedirect;
	this.SwfFile;
	this.minVersion;
	this.altSwfFile;
	this.altImage;
	this.altImageAddAtribute;
	this.altImageHTML;
	this.width;
	this.height;
	this.menu;
	this.background;
	this.wmode;
}
FlashObject.prototype.rnd=function(){
	this.ranNum= Math.random()*255;
    return this.ranNum;
}
FlashObject.prototype.embed=function(){
	var buff;
	if(getFlashVersion()>=this.maxVersion){
		buff=''+
			'<OBJECT ID="'+this.ID+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH='+this.width+' HEIGHT='+this.height+'><PARAM NAME=movie VALUE="'+this.SwfFile+'"><PARAM NAME=menu VALUE='+this.menu+'><param name="wmode" value="'+this.wmode+'"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="'+this.background+'">'+
				'<EMBED name="'+this.ID+'" src="'+this.SwfFile+'" menu="'+this.menu+'" wmode="'+this.wmode+'" quality="high" bgcolor="'+this.background+'"  WIDTH="'+this.width+'" HEIGHT="'+this.height+'" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swLiveConnect="true"></EMBED>'+
			'</OBJECT>';
	}else if((getFlashVersion()> this.minVersion) && (getFlashVersion()< this.maxVersion) && this.altSwfFile){
		buff=''+
			'<OBJECT ID="'+this.ID+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH='+this.width+' HEIGHT='+this.height+'><PARAM NAME=movie VALUE="'+this.altSwfFile+'"><PARAM NAME=menu VALUE='+this.menu+'<param name="wmode" value="'+this.wmode+'">><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE='+this.background+'>'+
				'<EMBED name="'+this.ID+'" src="'+this.altSwfFile+'" menu="'+this.menu+'" wmode="'+this.wmode+'" quality=high bgcolor='+this.background+'  WIDTH='+this.width+' HEIGHT='+this.height+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swLiveConnect="true"></EMBED>'+
			'</OBJECT>';
	}else{
		if (this.noFlashRedirect != undefined && this.noFlashRedirect != null){
			window.location.href=this.noFlashRedirect;
		}
		this.altImageAddAtribute ? (buff='<img src="'+this.altImage+'" width="'+this.width+'" height="'+this.height+'" border="0" '+this.altImageAddAtribute+' />'+this.altImageHTML) : (buff='<img src="'+this.altImage+'" width="'+this.width+'" height="'+this.height+'" border="0" />');
	}
	document.write(buff);
}

function init(){
	if (!document.getElementsByTagName) return;
	imgArray = document.getElementsByTagName("img");
		for (i=0;i<imgArray.length;i++){
			if(imgArray[i].alt!=-1) imgArray[i].title=imgArray[i].alt;
		}
	aArray = document.getElementsByTagName("a");
		for (i=0;i<aArray.length;i++){
			if(aArray[i] && aArray[i].href && !aArray[i].title && aArray[i].childNodes[0])	aArray[i].title = aArray[i].childNodes[0].nodeValue;
		}
}

function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external"){
			anchor.target = "_blank";
		}
	}
}

function extWin(src){
	ExtWin = window.open(src);
	ExtWin.focus();
	return false;
}


function getCenter(pwidth,pheight){
	wwidth=screen.width;
	wheigth=screen.height;
	lpos= (wwidth - pwidth)/2;
	tpos= (wheigth - pheight)/2;
	return lpos, tpos;
}

function PopItUp(src,w,h,s) {

	
	if(s) w=w+17;
	getCenter(w,h);
	Popwin = window.open(src,"popwin","toolbar=0,width=" + w + ", height=" + h + ", left="+ lpos +", top="+ tpos +"; location=0, directories=0, status=1, scrollbars="+s+", menubar=0, resizable=0, copyhistory=0");
	Popwin.focus();
	return false;
}

function PopItUp_Flash(src,w,h,s) {

	
	if(s) w=w+17;
	getCenter(w,h);
	Popwin = window.open(src,"popwin","toolbar=0,width=" + w + ", height=" + h + ", left="+ lpos +", top="+ tpos +"; location=0, directories=0, status=1, scrollbars="+s+", menubar=0, resizable=0, copyhistory=0");
	Popwin.focus();
}

function openWinOyun() {
	s=0;
	w=790;
	h=300;
	if(s) w=w+17;
	getCenter(w,h);
	Popwin = window.open("oyun/main.html","popwin","toolbar=0,width=" + w + ", height=" + h + ", left="+ lpos +", top="+ tpos +"; location=0, directories=0, status=1, scrollbars="+s+", menubar=0, resizable=0, copyhistory=0");
	Popwin.focus();
}

function ekartPencere() {
	s=0;
	w=760;
	h=460;
	if(s) w=w+17;
	getCenter(w,h);
	Popwin = window.open("uyelik/default.aspx","popwin","toolbar=0,width=" + w + ", height=" + h + ", left="+ lpos +", top="+ tpos +"; location=0, directories=0, status=1, scrollbars="+s+", menubar=0, resizable=0, copyhistory=0");
	Popwin.focus();
}


function PopItUp_Makale(src,w,h,s) {
	w=620;
	h=460;
	s=0;
	src="makaleler/makale.aspx"+ "?" + src;
	if(s) w=w+17;
	getCenter(w,h);
	Popwin = window.open(src,"popwin","toolbar=0,width=" + w + ", height=" + h + ", left="+ lpos +", top="+ tpos +"; location=0, directories=0, status=1, scrollbars="+s+", menubar=0, resizable=0, copyhistory=0");
	Popwin.focus();
}

function PopItUp_BF() {
	w=620;
	h=460;
	s=0;
	if(s) w=w+17;
	getCenter(w,h);
	Popwin = window.open("IBP_Bilgi_Formu.aspx","popwin","toolbar=0,width=" + w + ", height=" + h + ", left="+ lpos +", top="+ tpos +"; location=0, directories=0, status=1, scrollbars="+s+", menubar=0, resizable=0, copyhistory=0");
	Popwin.focus();
}

function EBebek_PopUp() {
	w=620;
	h=460;
	s=0;
	if(s) w=w+17;
	getCenter(w,h);
	Popwin = window.open("EBebek_PopUp.aspx","popwin","toolbar=0,width=" + w + ", height=" + h + ", left="+ lpos +", top="+ tpos +"; location=0, directories=0, status=1, scrollbars="+s+", menubar=0, resizable=0, copyhistory=0");
	Popwin.focus();
}

function getUrl(obj){
	selectedObj=obj.options[obj.selectedIndex];
	document.location.href=selectedObj.value;
	return true;
}

function getWindowHeight(){
	var windowHeight = 0;
	if(typeof(window.innerHeight) == 'number'){
		windowHeight = window.innerHeight;
	}else{
		if(document.documentElement && document.documentElement.clientHeight){
			windowHeight = document.documentElement.clientHeight;
		}else{
			if(document.body && document.body.clientHeight){
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function setFooter(){
	if (document.getElementById){
		var windowHeight = getWindowHeight();
		if (windowHeight>0){
			if (document.getElementById('subwrapper')) {
				var contentHeight = document.getElementById('subwrapper').offsetHeight;
				var footerElement = document.getElementById('footer');
				var footerHeight  = footerElement.offsetHeight;
				if (windowHeight - (contentHeight + footerHeight)>= 0) {
					footerElement.style.top = (windowHeight - (contentHeight+footerHeight+15)) + 'px';
				}else{
					footerElement.style.top = '0px';
				}
			}
		}
	}
}


var sonuclar = new Array("Y","D","Y","D","Y","Y");
var sonuc = 0;
var sorucevapdurum;
var sorusonuc;
function VerifyTest(){
	for (var k=0; k<sonuclar.length; k++){
		sorusonuc = document.getElementById("evet"+(k+1)).checked;
		if (sorusonuc==true){
			sorucevapdurum="D";
				if (sonuclar[k]==sorucevapdurum){
					sonuc = sonuc+1;
					document.getElementById("cevap"+(k+1)).style.display="none";
					document.getElementById("sonuc"+(k+1)).className="dogru";
				} else {
					document.getElementById("cevap"+(k+1)).style.display="none";
					document.getElementById("sonuc"+(k+1)).className="yanlis";
				}
		} else {
			sorucevapdurum="Y";
				if (sonuclar[k]==sorucevapdurum){
					sonuc = sonuc+1;
					document.getElementById("cevap"+(k+1)).style.display="none";
					document.getElementById("sonuc"+(k+1)).className="dogru";
				} else {
					document.getElementById("cevap"+(k+1)).style.display="none";
					document.getElementById("sonuc"+(k+1)).className="yanlis";
				}
		}
		document.getElementById("cevap"+(k+1)).style.display="none";
		document.getElementById("sonuc"+(k+1)).style.display="block";
	}
	/** Kaybolacak Elementler **/
	document.getElementById("tebrik").style.display="none";
	document.getElementById("tebrik_mesaj").style.display="none";
	document.getElementById("sonuclan").style.display="none";
	document.getElementById("sonucucur").style.display="none";
	/** Sonuca göre ekrana basılacak elementler **/
	document.getElementById("tebrik1").style.display="block";
		var newPara = document.getElementById("baslik_tebrik");
		var newText = document.createTextNode(sonuclar.length+" sorudan "+sonuc+" tanesini doğru cevaplandırdınız.");
			if (sonuc==sonuclar.length){
				newText = document.createTextNode("Tebrikler! Tüm soruları doğru cevaplandırdınız.");
			}
		newPara.appendChild(newText);

scroll(0,0);
sonuc = 0;
}

var hastaliklar = new Array("has_bogmaca","has_cicek","has_cocuk","has_difteri","has_grip","has_hepatita","has_hepatitb","has_hib","has_kabakulak","has_kizamik","has_kizamikcik","has_kizil","has_kolera","has_kuduz","has_menenjit","has_pno","has_sari","has_sucicegi","has_tifo")
function IllnessTable(illness){
		
		for (var k=0; k<hastaliklar.length; k++){
			if (document.getElementById(hastaliklar[k]).className=="breakme bleach"||document.getElementById(hastaliklar[k]).className=="breakme hm bleach"){
					document.getElementById(hastaliklar[k]).className="breakme hm bleach";
				} else {
					document.getElementById(hastaliklar[k]).className="hm bleach";
				}
			document.getElementById(illness).className="bl bleach";
		}
}


	/*function BabyDate(){
				var monthname=new Array("Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık")
				var d = document.getElementById("f_dday").value;
				var m = document.getElementById("f_dmonth").value;
				var y = document.getElementById("f_dyear").value;
				var SonTarih;
				var Name = document.getElementById("f_isim").value;
				var babyd = new Date(y,m,d);
				babyd = babyd.getTime();
				babyd = new Date(babyd);
				var GunBuGun = 1000*60*60*24;
				var yerler = document.getElementsByTagName("span");
				if (Name==""){
					window.alert ('Lütfen Bebeğinizin ismini yazın.');
					return;
				}
					for (var i=0; i<yerler.length; i++) {
						if (yerler[i].getAttribute("title")=="isim"){
							yerler[i].innerHTML = Name;
						}else if(yerler[i].getAttribute("title")=="babydue"){
							yerler[i].innerHTML = "<br />" + babyd.getDate()+" "+monthname[babyd.getMonth()]+" "+babyd.getFullYear()
							babyd = babyd.getTime()+30*GunBuGun;
							babyd = new Date(babyd);
						}else if(yerler[i].getAttribute("title")=="babydue2"){
							babyd = babyd.getTime()+60*GunBuGun;
							babyd = new Date(babyd);
							yerler[i].innerHTML = "<br />" + babyd.getDate()+" "+monthname[babyd.getMonth()]+" "+babyd.getFullYear()
						}else if(yerler[i].getAttribute("title")=="babydue3"){
							babyd = babyd.getTime()+90*GunBuGun;
							babyd = new Date(babyd);
							yerler[i].innerHTML = "<br />" + babyd.getDate()+" "+monthname[babyd.getMonth()]+" "+babyd.getFullYear()
						}else if(yerler[i].getAttribute("title")=="babydue4"){
							babyd = babyd.getTime()+180*GunBuGun;
							babyd = new Date(babyd);
							yerler[i].innerHTML = "<br />" + babyd.getDate()+" "+monthname[babyd.getMonth()]+" "+babyd.getFullYear()
						}else if(yerler[i].getAttribute("title")=="babydue5"){
							babyd = babyd.getTime()+2*360*GunBuGun;
							babyd = new Date(babyd);
							yerler[i].innerHTML = "<br />" + babyd.getDate()+" "+monthname[babyd.getMonth()]+" "+babyd.getFullYear()
						}
						document.getElementById("sozluk").className="bl";
						document.getElementById("asitakvimicontent").style.display="none";
						if (Name!=""){
							document.getElementById("asitakvimi_h3").style.display="block";	
						}else{
							document.getElementById("asitakvimi_h3").style.display="none";
						}
						document.getElementById("asitakvimi_p").style.display="block";	
					}
			}*/


function clearChoices()
	{
		if (document.forms['Form1'].cevap_5.checked)
		{
			document.forms['Form1'].cevap_6.checked = false;
			document.forms['Form1'].cevap_6.disabled = true;
		}
		else
		{
			document.forms['Form1'].cevap_6.disabled = false;
		}
	
	}

function ComboGo(){
		destination = document.getElementById("comboselect").options[document.getElementById("comboselect").selectedIndex].value+".aspx";
		if (destination) location.href = destination;

}
function ComboGoBread(){
		destination = "/AsiDunyasi"+document.getElementById("comboselect").options[document.getElementById("comboselect").selectedIndex].value;
		if (destination) location.href = destination;

}
window.onload = function() {
	init();
	externalLinks();
}

window.onresize = function() {
	setFooter();
}
