browserName=navigator.appName;
browserVer =parseInt(navigator.appVersion);
browserOk  =(browserName == "Netscape" && browserVer >= 3) || (browserVer >= 4);

function detail(pub_id,langue){
	var resultat="detail.asp?detail="+pub_id+"&Langue="+langue;
	popup=window.open(resultat, 'NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=350,height=250');
	if(browserOk){popup.pere=window};
}
	
function jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}
	
function clearField(formName, fieldName) {
	eval(formName + "." + fieldName + ".value='';");
}


function submitSearch()
{
	document.forms['formSearch'].submit();
}

function setValue() 
{
	if (document.forms['formSearch'].frmSearch.value==" Search Database")
	{
		document.forms['formSearch'].frmSearch.value="";
	}
}

function ToggleVisible( obj, objclicked ) {
	if (obj.style.display == "") {
		obj.style.display = "none";
	}
	else {
		obj.style.display = "";
		objclicked.style.color = "#999999"
	}
	return false;
}

function CheckDate(month,dayno, year)
{
   var text
   text = ''
   var retval = new String(dayno);
   var m = month + 1;
   
   for(var app = 0; app < apps.length; app++)
   {
      if(m == apps[app][1] ) //first month
      {
         if(apps[app][3] - apps[app][1] > 0)
         {
            if(dayno >= apps[app][0])
            {
				//if (text.length > 0) {
					text = text + " &#149; ";	
				//}
                text = text + apps[app][4];
            }
         }
         else
         {
            if(dayno >= apps[app][0] && dayno <= apps[app][2])
            {
				//if (text.length > 0) {
					text = text + " &#149; ";	
				//}
                text = text + apps[app][4];
            }
         }
      }
      else if(m == apps[app][3]) // second month
      {
         if(dayno <= apps[app][2])
         {
			//if (text.length > 0) {
				text = text + " &#149; ";	
			//}
            text = text + apps[app][4];
         }
      }
      else if( m > apps[app][1] && m < apps[app][3] )
      {    
		 //if (text.length > 0) {
			text = text + " &#149; ";	
		// }
         text = text + apps[app][4];
      }
   }
   if ((dayno == today[1] &&  month == today[2]) && text.length > 0 && year == today[3]) {
		retval = "<div class='todayactivity' title='";
   }
   else if (dayno == today[1] &&  month == today[2] && year == today[3]) {
		retval = "<div class='todaynoactivity' title='";
   }
   else if (text.length > 0) {
		retval = "<div class='activity' title='";
   }
   else {
	    retval = "<div class='noactivity' title='";
   }
   retval = retval + text + "'>" + dayno + "</div>" 
   return retval;
}

function PrintMonth(month,year,item,lang)
{
   var done = false;
   var day = 0;
   document.write("<table cellspacing=2 width=100%  class='calendar'><caption><p class=normalxsmall><a href=StartPage.asp?intItemID=2068&lang=" + lang + ">" + today[0] + "</a> " + today[1] + " " + months[today[2]] + " " + today[3] + "</p></caption><thead>");
   document.write("<th>" + weekdays[0] + "</th><th>" + weekdays[1] + "</th><th>" + weekdays[2] + "</th><th>" + weekdays[3] + "</th><th>" + weekdays[4] + "</th><th>" + weekdays[5] + "</th><th>" + weekdays[6] + "</th></thead>");
   while(!done)
   {
	  if ((day < 32) || (daycounts[month] == 31 && firstdays[month] >= 5) || (daycounts[month] == 30 && firstdays[month] == 6)) {
		document.write("<tr>");
		PrintWeek(month,year,day,firstdays[month], daycounts[month],item,lang);
		document.write("</tr>");
	  }
      day = day + 7;
      if( day > daycounts[month] + firstdays[month])
      {
         done = true;
      }
   }
   document.write("</tbody></table><img src=../img/1px.gif width=100 height=3>");
   document.write("<table cellspacing=0 width=100%><tr><td width=18 valign=top background=../img/base/GrayBG.gif><img border=0 width=13 height=13 src=../img/Common/calendar_box.gif></td><td background=../img/base/GrayBG.gif><span class='normalxsmall'>" + text[1] + "</span></td></tr>");
   //document.write("<tr><td width=18 valign=top background=../img/base/GrayBG.gif><img border=0 src=../img/Common/Arrow_Calendar_Left_small.gif> <img border=0 src=../img/Common/Arrow_Calendar_Right_small.gif></td><td background=../img/base/GrayBG.gif><span class='normalxsmall'>" + text[0] + "</span></td></tr>");
   document.write("<tr><td colspan=2 align=center background=../img/base/GrayBG.gif	><span class='normalxsmall'><a href=Calendar.asp?intItemID=" + item + "&lang=" + lang + "&year=" + year + "&month=" + (month + 1) + "&day=" + 1 + "&moreoption=1>" + text[2] + "</a></span></td></tr></table>");
}

function PrintWeek(monthno,year,start,min,max,item,lang)
{
   var d;
   var desc;
   for(var j = 0; j < 7; j++)
   {
      d = start + j;
      document.write("<td align=center><a href=Calendar.asp?intItemID=" + item + "&lang=" + lang + "&year=" + year + "&month=" + (monthno + 1) + "&day=" + (d - min + 1) + ">");
      if(d >= min && d < max + min)
      {
         desc = CheckDate(monthno,d - min + 1, year);
         document.write(desc);
      }
      document.write("</td>");
   }
}