// JavaScript Document
function abone(){
	window.open('popup/abonelik_formu.php','','status=yes,width=620,height=460')
}
function favori(){
	window.external.AddFavorite('http://www.otomobilgazetesi.com','Otomobil Haberleri');
}
function bize_ulasin(){
	window.open('popup/bize_ulasin.php','','status=yes,width=400,height=450');
}
function reklam_ver(){
	window.open('popup/reklam_pazarlama.php','','status=yes,width=440,height=180');
}
function tarih_goster(){
	days = new Array(7)
	days[1] = "Pazar";
	days[2] = "Pazartesi";
	days[3] = "Salı"; 
	days[4] = "Carşamba";
	days[5] = "Perşembe";
	days[6] = "Cuma";
	days[7] = "Cumartesi";
	months = new Array(12)
	months[1] = "Ocak";
	months[2] = "Şubat";
	months[3] = "Mart";
	months[4] = "Nisan";
	months[5] = "Mayıs";
	months[6] = "Haziran";
	months[7] = "Temmuz";
	months[8] = "Ağustos";
	months[9] = "Eylül";
	months[10] = "Ekim"; 
	months[11] = "Kasım";
	months[12] = "Aralık";
	today = new Date(); day = days[today.getDay() + 1]
	month = months[today.getMonth() + 1]
	date = today.getDate()
	year=today.getYear(); 
	if (year < 2000)
	year = year + 1900;
	document.write (date + " " + month + " " + day + " "  + year)
}
function yorum_yaz(id){
	window.open('haber_yorum/yorum_yaz.php?haberID='+id,'','width=400,height=400,resizable=yes');
}
function yorum_oku(id){
	window.open('haber_yorum/yorum_oku.php?haberID='+id,'','width=400,height=400,resizable=yes');
}
function toggle() {
	var ele = document.getElementById("toggleText");
	var text = document.getElementById("displayText");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "[+] Reklamı Göster";
  	}
	else {
		ele.style.display = "block";
		text.innerHTML = "[x] Reklamı Gizle";
	}
} 

/* Vimeo scripts */
// Tell Vimeo what function to call
		var oEmbedCallback = 'embedVideo';
		
		// Set up the URL
		var oEmbedUrl = 'http://vimeo.com/api/oembed.json';
		
		// Load the first one in automatically?
		var loadFirst = true;
		
		// This function puts the video on the page
		function embedVideo(video) {
			var videoEmbedCode = video.html;
			document.getElementById('embed').innerHTML = unescape(videoEmbedCode);
		}
		
		// This function runs when the page loads and adds click events to the links
		function init() {
			var links = document.getElementById('thumbs').getElementsByTagName('a');
			
			for (var i = 0; i < links.length; i++) {
				// Load a video using oEmbed when you click on a thumb
				if (document.addEventListener) {
					links[i].addEventListener('click', function(e) {
						var link = this;
						loadScript(oEmbedUrl + '?url=' + link.href + '&width=360&height=200&callback=' + oEmbedCallback);
						e.preventDefault();
					}, false);
				}
				// IE (sucks)
				else {
					links[i].attachEvent('onclick', function(e) {
						var link = e.srcElement.parentNode;
						loadScript(oEmbedUrl + '?url=' + link.href + '&width=360&height=200&callback=' + oEmbedCallback);
						return false;
					});
				}
			}
			
			// Load in the first video
			if (loadFirst) {
				loadScript(oEmbedUrl + '?url=' + links[0].href + '&height=200&width=360&callback=' + oEmbedCallback);
			}
		}
		
		// This function loads the data from Vimeo
		function loadScript(url) {
			var js = document.createElement('script');
			js.setAttribute('src', url);
			document.getElementsByTagName('head').item(0).appendChild(js);
		}
		
		// Call our init function when the page loads
		window.onload = init;

/* vimeo scripts - end */
