function go(arg_link, arg_page)
{
    if (arg_page==-1) page--; // previous
	else page++; // next

    //var myurl = "syllogos.php?page=" + page;
    var myurl = arg_link + "?page=" + page;
	location=myurl;
}


function goBack()
{
    var myurl1 = "http://www.sylagras.gr";
    var myurl2 = "http://sylagras.gr";
    var myurl3 = "sylagras.gr";

    // url 1
    if(document.referrer.substring(0,22) == myurl1)
        document.location.href = document.referrer; // doesn't work on opera
        //history.back();
    // url 2
    else if(document.referrer.substring(0,18) == myurl2)
        document.location.href = document.referrer; // doesn't work on opera
        //history.back();
    // url 3
    else if(document.referrer.substring(0,11) == myurl3)
        document.location.href = document.referrer; // doesn't work on opera
        //history.back();
    else
        document.location.href = "http://www.sylagras.gr";
}

function goBack(default_url)
{
    var myurl1 = "http://www.sylagras.gr";
    var myurl2 = "http://sylagras.gr";
    var myurl3 = "sylagras.gr";

    // url 1
    if(document.referrer.substring(0,22) == myurl1)
        document.location.href = document.referrer; // doesn't work on opera
        //history.back();
    // url 2
    else if(document.referrer.substring(0,18) == myurl2)
        document.location.href = document.referrer; // doesn't work on opera
        //history.back();
    // url 3
    else if(document.referrer.substring(0,11) == myurl3)
        document.location.href = document.referrer; // doesn't work on opera
        //history.back();
    else
        document.location.href = default_url ;
}




function openWindow(URL, width, height)
{
    var w = 640, h = 480;

    if (window.screen)
    {
        w = screen.availWidth;
        h = screen.availHeight;
    }

    var topPos = (h-height)/2, leftPos = (w-width)/2;
    var props = 'resizable=yes, toolbar=no, location=no, status=no, scrollbars=yes, menubar=no, titlebar=no, directories=no, copyhistory=no, width=' + width + ',height=' + height + ',left=' + leftPos + ',top=' + topPos + ',screenX=' + leftPos + ',screenY=' + topPos;

    window.open(URL, 'window', props);
}


function openWindow_v2(URL, windowID, width, height)
{
    var w = 640, h = 480;

    if (window.screen)
    {
        w = screen.availWidth;
        h = screen.availHeight;
    }

    var topPos = (h-height)/2, leftPos = (w-width)/2;
    var props = 'resizable=yes, toolbar=no, location=no, status=no, scrollbars=yes, menubar=no, titlebar=no, directories=no, copyhistory=no, width=' + width + ',height=' + height + ',left=' + leftPos + ',top=' + topPos + ',screenX=' + leftPos + ',screenY=' + topPos;

    window.open(URL, windowID, props);
}


