/* globals */
var t;
var i=0;

var timer2;
var deiktis2=0;

var image_slide = new Array();
image_slide[0]="./images/slideshow/syllogou2.jpg";
for (op=1;op<=6;op++)
	image_slide[op]="./images/slideshow/" + op + ".jpg";
image_slide[6]="./images/slideshow/syllogou.jpg";


function bookmark()	//title,url
	{
		var title = document.title;
		var url = location.href;
		
		if (window.sidebar) // firefox
			window.sidebar.addPanel(title, url, "");
		else if ( (window.opera) && (window.print) )	// opera
		{ 	
			var elem = document.createElement('a');
			elem.setAttribute('href',url);
			elem.setAttribute('title',title);
			elem.setAttribute('rel','sidebar');
			elem.click();
		}
		else if(document.all)	// ie
			window.external.AddFavorite(location.href,document.title);	//window.external.AddFavorite(url, title);
	}
	
	/*-------*/
	function image_rotator()	/* panw deksia */
	{
		document.getElementById('rotator').src = image_slide[i];
	
		i+=1;
		if (i>25)
			i=0;
			
		t = setTimeout('image_rotator()',2000);	//5 sec
	}
	
	/* ------------ */ 
	
	function start_slideshow()	/* photos page */
	{	
		document.getElementById('photogallery').src = image_slide[deiktis2];
	
		deiktis2 += 1;
		if (deiktis2 > 25)
			deiktis2 = 0;
			
		timer2 = setTimeout('start_slideshow()',2000);	//5 sec
	}
	
	function slideshow_pause()	/* photos page */
	{
		clearTimeout (timer2);
	}
	
	function slideshow_manual(vima)	/* photos page */
	{
		clearTimeout (timer2);

		deiktis2 = deiktis2 + vima;
		if (deiktis2 > 25)	//next
			deiktis2 = 0;
		if (deiktis2 < 0)	//previous
			deiktis2 = 25;
			
		document.getElementById('photogallery').src = image_slide[deiktis2];
	}
	
	/*-------*/
	function startTime()
	{
		var today=new Date();
		var h=today.getHours();
		var m=today.getMinutes();
		var s=today.getSeconds();
		// add a zero in front of numbers<10
		m=checkTime(m);
		s=checkTime(s);
		document.getElementById('time').innerHTML = h+":"+m+":"+s;
		t=setTimeout('startTime()',500);
	}
	
	function checkTime(i)
	{
		if (i<10)
		  i="0" + i;
		return i;
	}
	
	function open_comment_win(file, str, params)
	{
		var phpfile = file + ".php";
		window.open(phpfile,str,params);
		//px: 'com_insert.php','','width=550, height=270, scrollbars, resizable'
	}