// JavaScript Document
var c = 0;
var c2 = 0;
var c3 = 0;
var t;
var t2;
var t3;

function fbs_click(t, u) {
	u=location.href;
	//t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}

function newsBoxChange(){
	
	var index =  document.getElementById("indexCount").value;
	
	if (c == index){
		c = 0;
	}
	
	changeNews(c);
	c=c+1;
	t=setTimeout("newsBoxChange()",3000);
}

function galleryBoxChange(){
	
	var indexGallery =  document.getElementById("indexGalleryCount").value;
	//var indexVideo =  document.getElementById("indexVideoCount").value;
	
	if (c2 == indexGallery){
		c2 = 0;
	}
	
	changeGallery(c2);
	c2=c2+1;
	t2=setTimeout("galleryBoxChange()",7000);
}

function galleryBoxChangeIn(){
	
	var indexGallery =  document.getElementById("indexGalleryCount").value;
	var indexVideo =  document.getElementById("indexVideoCount").value;
	
	if (c2 == indexGallery){
		c2 = 0;
	}
	
	changeGalleryIn(c2);
	c2=c2+1;
	t2=setTimeout("galleryBoxChangeIn()",7000);
}

function videoBoxChange(){
	
	var indexVideo =  document.getElementById("indexVideoCount").value;
	
	if (c3 == indexVideo){
		c3 = 0;
	}
	
	changeVideo(c3);
	c3=c3+1;
	t3=setTimeout("videoBoxChange()",5000);
}

function videoBoxChangeIn(){
	
	var indexVideo =  document.getElementById("indexVideoCount").value;
	
	if (c3 == indexVideo){
		c3 = 0;
	}
	
	changeVideoIn(c3);
	c3=c3+1;
	t3=setTimeout("videoBoxChangeIn()",5000);
}


function changeNews(i) {
	
	var newsBlock = document.getElementById("news" + i);
	
	var nHref = newsBlock.getAttribute("href");
	var nSubject = newsBlock.getAttribute("subject");
	var nText = newsBlock.getAttribute("text");
	var nPic =  newsBlock.getAttribute("photo");
	//hotphoto.style.backgroundImage = "url(" + newblock.getAttribute("photo") + ")"
	
	if (t) {
		window.clearTimeout(t);
	}
	
	document.getElementById('newsTitle').innerHTML = '<a href="'+nHref+'">' + nSubject + '</a>';
	document.getElementById('nDesc').innerHTML = '<a href="'+nHref+'">' + nText + '</a>';
	document.getElementById('nImg').innerHTML = '<a href="'+nHref+'">' + '<img border="0" width="239" height="190" src="'+ nPic +'" /></a>';
}


function changeWriters(i) {
	
	var writersBlock = document.getElementById("writers" + i);
	
	var nHref = writersBlock.getAttribute("href");
	var nSubject = writersBlock.getAttribute("subject");
	var nText = writersBlock.getAttribute("text")+'...';
	var nPic =  writersBlock.getAttribute("photo");
	
	document.getElementById('writerDesc').innerHTML ='<a href="'+nHref+'">' + nText + '</a>';
	document.getElementById('writerPic').innerHTML = '<a href="'+nHref+'">' + '<img border="0" title="'+ nSubject +'" width="112" src="'+ nPic +'" /></a>';

}

function changeGallery(i) {
	
	var galeryBlock = document.getElementById("galleries" + i);
	
	var nHref = galeryBlock.getAttribute("href");
	var nSubject = galeryBlock.getAttribute("subject");
	var nText = galeryBlock.getAttribute("text");
	var nPic =  galeryBlock.getAttribute("photo");
	
	if (t2) {
		window.clearTimeout(t2);
	}
	
	document.getElementById('PicContent').innerHTML = '<a href="'+ nHref +'"><img title="'+ nSubject +'" src="'+ nPic +'" width="260" height="172" border="0" /></a>';
}

function changeGalleryIn(i) {
	
	var galeryBlock = document.getElementById("galleries" + i);
	
	var nHref = galeryBlock.getAttribute("href");
	var nSubject = galeryBlock.getAttribute("subject");
	var nText = galeryBlock.getAttribute("text");
	var nPic =  galeryBlock.getAttribute("photo");
	
	if (t2) {
		window.clearTimeout(t2);
	}
	
	document.getElementById('PicContent').innerHTML = '<a href="'+ nHref +'"><img title="'+ nSubject +'" src="'+ nPic +'" width="188" height="172" border="0" /></a>';
}


function changeVideo(i) {
	
	var videoBlock = document.getElementById("movies" + i);
	
	var nHref = videoBlock.getAttribute("href");
	var nSubject = videoBlock.getAttribute("subject");
	var nText = videoBlock.getAttribute("text");
	var nPic =  videoBlock.getAttribute("photo");
	var nClass =  videoBlock.getAttribute("class");
	
	if (t3) {
		window.clearTimeout(t3);
	}
	
	document.getElementById('MovieContent').innerHTML = '<a href="'+ nHref +'"><img title="'+ nSubject +'" src="'+ nPic +'" width="325" height="136" border="0" /></a>';
}

function changeVideoIn(i) {
	
	var videoBlock = document.getElementById("movies" + i);
	
	var nHref = videoBlock.getAttribute("href");
	var nSubject = videoBlock.getAttribute("subject");
	var nText = videoBlock.getAttribute("text");
	var nPic =  videoBlock.getAttribute("photo");
	var nClass =  videoBlock.getAttribute("class");
	
	if (t3) {
		window.clearTimeout(t3);
	}
	
	document.getElementById('MovieContent').innerHTML = '<a href="'+ nHref +'"><img title="'+ nSubject +'" src="'+ nPic +'" width="288" height="136" border="0" /></a>';
}

function openCanliSkor() {
	window.open('canliSkor.php','canliSkor','toolbar=0,location=no,directories=0,status=0,menubar=0,scrollbars=0,body topmargin=0,leftmargin=0,resizable=0,width=620,height=480');	
}

function openYazdir(mode, id) {
	window.open('yazdir.php?mode='+mode+'&id='+id+'','icerikYazdir','toolbar=0,location=no,directories=0,status=0,menubar=0,scrollbars=0,body topmargin=0,leftmargin=0,resizable=0,width=550,height=480');	
}

function openBilgiBandi(url, w, h) {
	window.open(url,'bilgiBandi','toolbar=0,location=no,directories=0,status=0,menubar=0,scrollbars=0,body topmargin=0,leftmargin=0,resizable=0,width='+ w +',height='+ h);	
}

function openSendMail(pUrl) {
	window.open('sendToMail.php?url='+escape(pUrl),'sendToFriend','toolbar=0,location=no,directories=0,status=0,menubar=0,scrollbars=0,body topmargin=0,leftmargin=0,resizable=0,width=380,height=520');	
}

function postIt() {
	var data = document.formUyeOl;

	if (data.maillistAd.value == "") {
		alert("Lütfen adınızı ve soyadınızı giriniz.");
		data.maillistAd.focus();
		return false;
	}

	var at = data.maillistEmail.value.indexOf('@');
	var nokta = data.maillistEmail.value.indexOf('.');
	var boy = data.maillistEmail.value.length;

	if ( !(at >= 1 && nokta >= 1 && nokta < (boy-1)) ) {
		alert("Lütfen geçerli bir mail adresi giriniz.");
		data.maillistEmail.focus();
		return false;
	}
	
	return true;
}

function postUnsubscribe() {
	var data = document.formUyelikCikart;

	var at = data.maillistEmail.value.indexOf('@');
	var nokta = data.maillistEmail.value.indexOf('.');
	var boy = data.maillistEmail.value.length;

	if ( !(at >= 1 && nokta >= 1 && nokta < (boy-1)) ) {
		alert("Lütfen geçerli bir mail adresi giriniz.");
		data.maillistEmail.focus();
		return false;
	}
	
	return true;
}

function CreateBookmarkLink() {

	
	
	title = "VoleybolMagazin.Com"; 
	
	 url = "http://www.voleybolmagazin.com/";

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); 
	} else if(window.opera && window.print) { // Opera Hotlist
		return true; }
}



var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-20142998-3']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();















