function sendThisPage( aTag) {
var ifr = document.getElementById( 'IFR');
var url = aTag.href
if (ifr != null) {
url = url + '&ifrSrc=' + ifr.src;
}
location.href=url
}
function replaceImgAlt( srcs, alts, doc){
var imgs = (doc != null)? doc.images: document.images;
for( i= 0; i < imgs.length; i++) {
for( j = 0; j < srcs.length; j++) {
if (imgs[i].src.indexOf(srcs[j]) >= 0) {
imgs[i].alt = alts[j];
}
}
}
}
function writeRssLink(link){
var url = "http://"+location.host+link;
document.write( ""+url+"");
}
function openContent( url) {
var content=parent.document.getElementById( 'IFR');
if (content != null) {
content.src=url;
}
}
function openRightWidget( url) {
var content=parent.document.getElementById( 'RIGHT_WIDGET');
if (content != null) {
content.src=url;
}
}
function openInternal( url) {
var frm = document.forms['hidden'];
var targetPage = (frm.internalsLinkTargetPage!=null)?frm.internalsLinkTargetPage.value:"";
if (targetPage == "") {
var contentFrame = document.getElementById( 'IFR');
contentFrame = (contentFrame == null)
?document.getElementById( 'advSearchViewer')
:contentFrame;
contentFrame.src = url;
}
else {
var newUrl = "/"+frm.dbn.value+"/pages/"+targetPage+
"_"+frm.LAN.value+"?OpenDocument&emb="+url;
location.href = newUrl;
}
}
function changeLanguage(lan){
var doc=document.forms['hidden'];
var url=location.href;
var lng=doc.LAN.value;
var key=doc.keyext.value;
var kk=doc.key.value;
if (!key || key==""){
url=replaceParamValue(url, "lan", lan);
}
else {
if (url.toLowerCase().indexOf(key)>-1) {
url=myReplace(url,key,kk+"_"+lan);
}
url="/"+doc.dbn.value+"/pages/"+kk+"_"+lan+"?OpenDocument";
}
//alert (lan+"\n"+url)
location=url;
}
function myReplace(stin, torep, rep){
var lstin=stin.toLowerCase();
var i=lstin.indexOf(torep);
while (i>-1){
stin=stin.substring(0,i)+rep+stin.substring(i+torep.length)
lstin=stin.toLowerCase();
i=lstin.indexOf(torep,i+rep.length+1);
}
return stin;
}
function adjustRedirectToLoginForm(iframeName) {
var iframeWin = window.frames[iframeName];
//var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? //document.all[iframeName]: null;
if ( /*iframeEl != null && */ iframeWin != null) {
var iFrameDocument = iframeWin.document;
//alert( 'document: '+iframeWin.document)
var dominoForm = iFrameDocument .forms[ '_DominoForm'];
if (dominoForm != null && dominoForm.action=='/names.nsf?Login') {
var doch=document.forms['hidden'];
var newRedirectTo = '/'+doch.dbn.value+'/popOutOnPage?OpenForm&page='+doch.keyext.value+'&emburl='+dominoForm.RedirectTo.value
dominoForm.RedirectTo.value = newRedirectTo
}
}
}
function logininvio()
{
var charCode = (event.which) ? event.which : event.keyCode
if (charCode == 13) {
doLogin(true)
}
}
function doLogin( medaEte){
medaEte = (medaEte == null)? false: medaEte;
var frm = document.forms['_Login'];
if (frm && frm.username.value!="" && frm.password.value!="") {
if (medaEte) {
var forumUrl = getSelectedForumUrl();
if (forumUrl != null) {
frm.RedirectTo.value = forumUrl;
}
else {
frm.RedirectTo.value = location.href;
}
}
else {
frm.RedirectTo.value = location.href;
}
frm.submit()
}
else {
alert('please insert username and password');
return;
}
}
function goSelectedArea(){
var doc=document.forms['leftmenu'];
var doch=document.forms['hidden'];
var fld=doc.tare;
if (fld){
var key=fld[fld.selectedIndex].value;
var k=fld[fld.selectedIndex].id;
if (key=="" || key=="#" ) {
if (fld.selectedIndex>0)
alert ('page not available');
}
else {
var url="/"+doch.dbn.value+"/pages/"+key+"_"+doch.LAN.value+"?Opendocument&ta="+k
if (doch.VER.value!="") url=url+"&VER"+doch.VER.value;
location=url;
}
}
}
function goSelectedCountry(){
var doc=document.forms['leftmenu'];
var doch=document.forms['hidden'];
var fld=doc.cntr;
if (fld){
var key=fld[fld.selectedIndex].value;
var k=fld[fld.selectedIndex].id;
if (key=="") {
if (fld.selectedIndex>0)
alert ('page not available');
}
else {
var url="/"+doch.dbn.value+"/pages/"+key+"_"+doch.LAN.value+"?Opendocument&c="+k
if (doch.VER.value!="") url=url+"&VER"+doch.VER.value;
location=url;
}
}
}
function getSelectedForumUrl() {
var rtn = null;
var doch=document.forms['hidden'];
var fld=document.getElementById('forumsid');
if (fld && fld.selectedIndex > 0){
var key=fld[fld.selectedIndex].text;
if (key!="") {
rtn="/"+doch.dbn.value+"/forums/"+key+"?Opendocument"
}
}
return rtn;
}
function goSelectedForum(){
var doc=document.forms['_Login'];
var doch=document.forms['hidden'];
var fld=document.getElementById('forumsid');
if(fld.selectedIndex==0)
return
if (fld){
var key=fld[fld.selectedIndex].text;
//var k=fld[fld.selectedIndex].id;
if (key=="") {
if (fld.selectedIndex>0)
alert ('page not available');
}
else {
location="/"+doch.dbn.value+"/forums/"+key+"?Opendocument"
}
}
}
function printable(){
var iframeWin = window.frames['IFR'];
if (iframeWin!=null && iframeWin.location.href!=""){
/* var purl=retAddParameter(location.href,'Printable');
var url=replaceParamValue(purl,'emburl',iframeWin.location.href);
location=url;
*/
window.open( iframeWin.location.href);
}
else {
addParameter('Printable');
}
}
function replaceParamValue(url, paramname, newvalue){
var resto="";
var indx = url.indexOf("#");
if (indx > -1){
resto = url.substring(indx);
url = url.substring(0,indx);
}
indx = url.indexOf("&"+paramname+"=");
if (indx>-1){
var indx2 = (url+"&").indexOf("&",indx+1);
url=url.substring(0,indx)+"&"+paramname+"="+newvalue+url.substring(indx2)
}
else {
url = url+"&"+paramname+"="+newvalue;
}
return (url+resto);
}
function changeViewCat(fld){
var url=location.href;
var valr=fld[fld.selectedIndex].value;
location=replaceParamValue(url,"cat",valr);
}
function changeViewCatFlat(newcat){
var url=location.href;
location=replaceParamValue(url,"cat",escape(newcat));
}
function addParameter(param){
var url=location.href;
location=retAddParameter(url,param);
}
function retAddParameter(url,param){
var resto="";
if (url.indexOf("&"+param)==-1){
var indx = url.indexOf("#");
if (indx > -1){
resto = url.substring(indx);
url = url.substring(0,indx);
}
url = url+"&"+param;
return url+resto;
}
}
function removeParameter(param){
var url=location.href;
var resto="";
ind=url.indexOf("&"+param);
if (ind>-1){
resto = url.substring(ind+param.length+1);
url = url.substring(0,ind);
location=url+resto;
}
}
function cerca(){
var doc=document.forms['header'];
var doch=document.forms['hidden'];
var cerca=doc.query.value;
if (cerca!=""){
var url="/"+doch.dbn.value+"/SearchTemplateDefault?OpenForm&lan="+doch.LAN.value+"&query="+cerca
location=url;
return false;
}
else alert('Please insert something to search');
}
function selectCanGoKeyDown( select, goFunction) {
var code;
if (!e) var e = window.event;
if (e.keyCode == 13 && select.canGo != null && select.canGo) {
if (goFunction != null)
goFunction.call();
else
alert( 'Go function required')
}
else
select.canGo = false;
}
function selectCanGoChange( select) {
select.canGo = true;
}
function headerkp(e){
var code;
if (!e) var e = window.event;
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
var character = String.fromCharCode(code);
// alert('Character was ' + character);
if (code == 13) {
return cerca();
}
}
function changepage(redir){
var ifr = window.frames['IFR'];
if (ifr && ifr.location.href.toLowerCase().indexOf("?editdocument")>-1) {
alert ('You have a form open in edit, please close it before logging out');
}
else {
top.location.href= redir;
}
}
function CatPrec(l){
var url="";
var trovato=false;
status='';
for (var i=0;(i=0)
{
url=document.links[i-1].href;
trovato=true
}
}
if (trovato)
{
location=url;
}
}
var arrPrograms=[
['Algeria','Mediterranean_Region_Algeria','Algeria'],
['Egypt','Mediterranean_Region_Egypt','Egypt'],
['Israel','Mediterranean_Region_Israel','Israel'],
['Jordan','Mediterranean_Region_Jordan','Jordan'],
['Lebanon','Mediterranean_Region_Lebanon','Lebanon'],
['Morocco','Mediterranean_Region_Morocco','Morocco'],
['Syria','Mediterranean_Region_Syria','Syria'],
['Tunisia','Mediterranean_Region_Tunisia','Tunisia'],
['Turkey','Enlargement_Turkey','Turkey'],
['WestBankGazaStrip','Mediterranean_Region_West_Bank_and_Gaza_Strip','WBGS']
];
function mapclick(fname){
var doc=document.forms['hidden'];
var t=false;
var link="";
for (var i=0;iHELPClose"+txtHLP+"