function ajax()
{
	var xmlHttp= null
	try {
		xmlHttp= new XMLHttpRequest()
	}
	catch (e)
	{
		try {
			xmlHttp= new ActiveXObject('Msxml2.XMLHTTP')
		}
		catch (e)
		{
			xmlHttp= new ActiveXObject('Microsoft.XMLHTTP')
		}
	}
	return xmlHttp
}

function statExtLinks()
{
	objs= document.getElementsByTagName('a')
	for(f=0; f<objs.length; f++) {
		if (objs[f].target=='_blank') {
			objs[f].setAttribute('onclick','stat(this)')
			objs[f].setAttribute('title','Δείτε περισσότερα (' + objs[f].innerHTML + ')')
		}
	}
}

function stat(obj)
{
	if (admin==false) {
		var xmlHttp= ajax()
		xmlHttp.open('get','ajax/?stat=' + obj.href)
		xmlHttp.send(null)
	}
}

function statMediaViews()
{
	objs= document.getElementsByTagName('a')
	for(f=0; f<objs.length; f++) {
		if (objs[f].id.substr(0,3)=='inl') objs[f].setAttribute('onclick','media(this,\'media\')')
		if (objs[f].className=='hr') objs[f].setAttribute('onclick','media(this,\'zoom\')')
	}
}

function media(obj,mType)
{
	if (admin==false) {
		var xmlHttp= ajax()
		xmlHttp.open('get','ajax/?media=' + mType + ': ' + obj.title)
		xmlHttp.send(null)
	}
}

function blurLinks()
{
	lnks= document.getElementsByTagName('a')
	for(f=0; f<lnks.length; f++) lnks[f].setAttribute('onfocus','this.blur()')
}

function autoComplete()
{
	inputs= document.getElementsByTagName('input')
	for(f=0; f<inputs.length; f++){
		if (inputs[f].getAttribute('type')=='text') inputs[f].setAttribute('autocomplete','off')
	}
}

function evalArg()
{
	if (document.location.href != 'http://' + document.domain + '/') {
		var varArray= document.location.href.split('?')[1].split('&')
		for(var x=0; x<varArray.length; x++) {
			var tmp = varArray[x].split('=')
			eval(unescape(tmp[0]) + '="' + unescape(tmp[1]) + '"')
		}
	}
}

function include(filename)
{
	var head= document.getElementsByTagName('head')[0]
	script= document.createElement('script')
	script.type= 'text/javascript'
	script.src= filename
	head.appendChild(script)
}

//--------------------------------------------------------------------------------------------------------//

var admin= false

window.onload= function()
{
	if (admin==false) {
		try {
			var pageTracker= _gat._getTracker('UA-277493-9')
			pageTracker._trackPageview()
		}
		catch(err) {}
	}
	$(document).ready(function() { $("a.hr").fancybox({ 'imageScale':true,'zoomSpeedIn':600,'zoomSpeedOut':600 }); });
	statExtLinks()
	statMediaViews()
}