// copyright (c) 2007, Archimedia S.A., www.archimedia.gr
// Koinoxrhsta for oracle portal
// v1.0

function opSetLanguage(w, lang)
{
	var win = w ? w : self;

	var pageURL = escape(win.location.href);
	var ctxURL =win.location.protocol + "//" + win.location.host  + "/portal/pls/portal/PORTAL.wwctx_app_language.set_language?";

	if(lang == "us" || lang == "en")
	{
		ctxURL += "p_http_language=en-us&p_nls_language=us&p_nls_territory=AMERICA";
	}
	else
	{
		ctxURL += "p_http_language=el-gr&p_nls_language=el&p_nls_territory=GREECE";
	}

	ctxURL += ("&p_requested_url=" + pageURL);
	win.location = ctxURL;
}

function opLogin(w)
{
	var win = w ? w : self;

	var pageURL = escape(win.location.href);
	var ctxURL = win.location.protocol + "//" + win.location.host + "/portal/pls/portal/PORTAL.wwsec_app_priv.login?";
	ctxURL += ("p_requested_url=" + pageURL + "&p_cancel_url=" + pageURL);
	win.location = ctxURL;
}

function opLogout(w)
{
	win.location = opGetLogoutURL(w);
}

function opGetLogoutURL(w)
{
	var win = w ? w : self;

	var pageURL = escape(win.location.href);
	var ctxURL = win.location.protocol + "//" + win.location.host  + "/portal/pls/portal/PORTAL.wwsec_app_priv.logout";

	return ctxURL;
}
