// JavaScript Document

function popwin(url)
{
	w = 800;
	h = 600;
	wleft = (screen.width - w) / 2;
  	wtop = (screen.height - h) / 2;
	
	//Check that the popup is inside screen area
	if (wleft < 0) {
   		w = screen.width;
    	wleft = 0;
  	}
  	if (wtop < 0) {
    	h = screen.height;
    	wtop = 0;
  	}
	
	var win = window.open(url, 'popup',	'width=' + w + ', height=' + h + ', ' +
    									'left=' + wleft + ', top=' + wtop + ', ' +
    									'location=no, menubar=no, ' +
    									'status=no, toolbar=no, scrollbars=yes, resizable=no');
	//Just in case..
	win.resizeTo(w, h);
	win.moveTo(wleft, wtop);
	win.focus();
}


function popvideo(url)
{
	w = screen.width;
	h = screen.height;

	wleft = (screen.width - w) / 2;
  	wtop = (screen.height - h) / 2;
	
	//Check that the popup is inside screen area
	if (wleft < 0) {
   		w = screen.width;
    	wleft = 0;
  	}
  	if (wtop < 0) {
    	h = screen.height;
    	wtop = 0;
  	}
	
	var win = window.open(url, 'popup',	'width=' + w + ', height=' + h + ', ' +
    									'left=' + wleft + ', top=' + wtop + ', ' +
    									'location=no, menubar=no, ' +
    									'status=no, toolbar=no, scrollbars=yes, resizable=no');
	//Just in case..
	win.resizeTo(w, h);
	win.moveTo(wleft, wtop);
	win.focus();
}


function updatecounter(url)
{
	var cnt = new Image();
	cnt.src = "http://www.mead.upatras.gr/others/smsa/counter.asp?p=" + url;
}

function resethits()
{
	var cnt = new Image();
	cnt.src = "http://www.mead.upatras.gr/others/smsa/reset.asp";
	setTimeout("window.location.reload();",2000);
	
}

