function TDateTimeInput(prefix){
	var _instance = this;

	this.month_days = new Array(
	    31,[28,29],31,30,31,30,31,31,30,31,30,31
	    );

	this.clearOptions = function(parent_el){
		ret = parent_el;
	    ch = ret.childNodes;
	    l = ch.length;
	    for(i=l-1;i>-1;i--){
	        ret.removeChild(ch.item(i));
	    }
	    return ret;
	}
	
	this.generateOptions = function(parent_el,start_val,end_val,sel_val){
		ret = parent_el;
	    for(i=start_val;i<=end_val;i++){
	        o = document.createElement('option');
	        o.value = i<10?'0'+i:i;
	        if(o.value==sel_val)
	            o.setAttribute("selected","selected");
	        ot = document.createTextNode(i<10?'0'+i:i);
	        o.appendChild(ot);
	        ret.appendChild(o);
	    }
	    return ret;
	}
	
	this.year_dd = document.getElementById(prefix+'Year');
	this.month_dd = document.getElementById(prefix+'Month');
	this.day_dd = document.getElementById(prefix+'Day');
	
	this.year_dd.onchange = function(){
		id = this.id.substr(0,this.id.lastIndexOf('_'));
	    m = document.getElementById(id+'Month');
	    if(m.value!='02')
	        return true;
	    d = document.getElementById(id+'Day');
	    if(this.value%4==0&&(this.value%100!=0||this.value%400==0)){
	        d = _instance.clearOptions(d);
	        d = _instance.generateOptions(d,1,_instance.month_days[1][1],0);
	    }else{
	        d = _instance.clearOptions(d);
	        d = _instance.generateOptions(d,1,_instance.month_days[1][0],0);
	    }
	}
	
	this.month_dd.onchange = function(){
		id = this.id.substr(0,this.id.lastIndexOf('_'));
	    y = document.getElementById(id+'Year');
	    d = document.getElementById(id+'Day');        
	    if(this.value=='02'&&y.value%4==0&&(y.value%100!=0||y.value%400==0)){
	        d = _instance.clearOptions(d);
	        d = _instance.generateOptions(d,1,_instance.month_days[1][1],0);
	    }else if(this.value=='02'){
	        d = _instance.clearOptions(d);
	        d = _instance.generateOptions(d,1,_instance.month_days[1][0],0);
	    }else{
	        d = _instance.clearOptions(d);
	        d = _instance.generateOptions(d,1,_instance.month_days[this.value-1],0);
	    }
	}
	
	switch(this.month_dd.value){
        case "01":
        case "03":
        case "05":
        case "07":
        case "08":
        case "10":
        case "12":
            return;
        case "02":
            //remove one day
            this.day_dd.removeChild(this.day_dd.lastChild);
            //if not leap year remove another day
            if(this.year_dd.value%4!=0||(this.year_dd.value%100==0&&this.year_dd.value%400!=0))
                this.day_dd.removeChild(this.day_dd.lastChild);
        case "04":
        case "06":
        case "09":
        case "11":
            //remove one day
            this.day_dd.removeChild(this.day_dd.lastChild);
    }
}

function showCalendar(id){
	var obj = eval("pop"+id);
	var status = obj.style.display;
	if(status == "none"){
		status = "block";
	} 
	else{
		status = "none";
	}	
	obj.style.display = status;
}
function popupWindow(url) {
	window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
/*function switchShort(el) {
	mDiv = document.getElementById(el);
	if (mDiv.style.display == "none") {
		mDiv.style.display = "block";
	} else {
		mDiv.style.display = "none";
	}
}*/
function switchShort(el) {
	if (document.getElementById("descr_" + el).style.display == "none") {
		document.getElementById("descr_" + el).style.display = "block";
		//document.getElementById("line_" + el).style.display = "block";
	} else if(document.getElementById("descr_" + el).style.display == "block") {
		document.getElementById("descr_" + el).style.display = "none";
		//document.getElementById("line_" + el).style.display = "none";
	}
}
function showMap(el1,el2) {
	document.getElementById(el1).style.display = "none";
	document.getElementById(el2).style.display = "block";
}
function hideMap(el1,el2) {
	document.getElementById(el1).style.display = "block";
	document.getElementById(el2).style.display = "none";
}
function switchDivs(index, el, hide) {
	mDiv = document.getElementById(index);
	if (mDiv.style.display == "none") {
		mDiv.style.display = "block";
		document.getElementById(el).style.display = "none";
		document.getElementById(hide).style.display = "block";
	} else {
		mDiv.style.display = "none";
		document.getElementById(el).style.display = "block";
		document.getElementById(hide).style.display = "none";
	}
}
//function switchDivs(index, el, hide) {
//	mDiv = document.getElementById(index);
//	if (mDiv.style.display == "none") {
//		mDiv.style.display = "";
//		document.getElementById(el).style.display = "none";
//		document.getElementById(hide).style.display = "";
//	} else {
//		mDiv.style.display = "none";
//		document.getElementById(el).style.display = "";
//		document.getElementById(hide).style.display = "none";
//	}
//}
function openBrWindow(theURL,winName,features) 
{
  window.open(theURL,winName,features);
}
function showZoom(pic,w,h)
{
	open('/pic/'+pic,'','width='+w+',height='+h);
}
/*function filterNavigate(what, sel){
	if(sel!=0){
		document.location = "?" + what + "=" + sel;
	}
	else{
		document.location="<?=suBASE?><?=NEW_EVENTS_URL?>";
	}
}*/
function showAirlineMap(id){
//	var c = document.getElementById('air_'+id).style.color='red';
	document.getElementById('default').innerHTML = document.getElementById(id).innerHTML;
}

function TDateTimeInput2(prefix){

	var _instance = this;

	this.month_days = new Array(
	    31,[28,29],31,30,31,30,31,31,30,31,30,31
	    );

	this.clearOptions = function(parent_el){
		ret = parent_el;
	    ch = ret.childNodes;
	    l = ch.length;
	    for(i=l-1;i>-1;i--){
	        ret.removeChild(ch.item(i));
	    }
	    return ret;
	}
	
	this.generateOptions = function(parent_el,start_val,end_val,sel_val){
		ret = parent_el;
	    for(i=start_val;i<=end_val;i++){
	        o = document.createElement('option');
	        o.value = i<10?'0'+i:i;
	        if(o.value==sel_val)
	            o.setAttribute("selected","selected");
	        ot = document.createTextNode(i<10?'0'+i:i);
	        o.appendChild(ot);
	        ret.appendChild(o);
	    }
	    return ret;
	}
	this.year_dd = document.getElementById(prefix+'Year');
	this.month_dd = document.getElementById(prefix+'Month');
	this.day_dd = document.getElementById(prefix+'Day');
	
	this.year_dd.onchange = function(){
		id = this.id.substr(0,this.id.lastIndexOf('_'));
	    m = document.getElementById(id+'Month');
	    if(m.value!='02')
	        return true;
	    d = document.getElementById(id+'Day');
	    if(this.value%4==0&&(this.value%100!=0||this.value%400==0)){
	        d = _instance.clearOptions(d);
	        d = _instance.generateOptions(d,1,_instance.month_days[1][1],0);
	    }else{
	        d = _instance.clearOptions(d);
	        d = _instance.generateOptions(d,1,_instance.month_days[1][0],0);
	    }
	}	
	this.month_dd.onchange = function(){
		id = this.id.substr(0,this.id.lastIndexOf('_'));
	    y = document.getElementById(id+'Year');
	    d = document.getElementById(id+'Day');        
	    if(this.value=='02'&&y.value%4==0&&(y.value%100!=0||y.value%400==0)){
	        d = _instance.clearOptions(d);
	        d = _instance.generateOptions(d,1,_instance.month_days[1][1],0);
	    }else if(this.value=='02'){
	        d = _instance.clearOptions(d);
	        d = _instance.generateOptions(d,1,_instance.month_days[1][0],0);
	    }else{
	        d = _instance.clearOptions(d);
	        d = _instance.generateOptions(d,1,_instance.month_days[this.value-1],0);
	    }
	}
	
	switch(this.month_dd.value){
        case "01":
        case "03":
        case "05":
        case "07":
        case "08":
        case "10":
        case "12":
            return;
        case "02":
            //remove one day
            this.day_dd.removeChild(this.day_dd.lastChild);
            //if not leap year remove another day
            if(this.year_dd.value%4!=0||(this.year_dd.value%100==0&&this.year_dd.value%400!=0))
                this.day_dd.removeChild(this.day_dd.lastChild);
        case "04":
        case "06":
        case "09":
        case "11":
            //remove one day
            this.day_dd.removeChild(this.day_dd.lastChild);
    }
}



 function BrowserCheck() {
   var b = navigator.appName
   if (b=="Netscape") this.b = "ns"
   else if (b=="Microsoft Internet Explorer") this.b = "ie"
   else this.b = b
   this.version = navigator.appVersion
   this.v = parseInt(this.version)
   this.ns = (this.b=="ns")
   this.ns6 = (this.b=="ns" && this.v>=5)
   this.ie6 = (this.version.indexOf('MSIE 6')>0)
   this.min = (this.ns||this.ie)
 }
 is = new BrowserCheck()


var currDate = new Date();
var outDate = new Date(currDate.getFullYear(),currDate.getMonth(),currDate.getDate());
var inDate = new Date(outDate.getFullYear(),outDate.getMonth(),outDate.getDate() + 1);
/* begin of miscfunctions */

function trimLeft(str) {
  var _len = str.length;
  var _i;
  var _result = new String(str);
  if (_len < 1) {
    return _result;
  }
  for (_i = 0; _i < _len; _i++) {
    if ((str.charCodeAt(_i) > 32) || (str.charCodeAt(_i) < -1)) {
      break;
    }
  }
  if (_i < 1) {
    return _result;
  }
  _result = _result.substring(_i,_len);
  return _result;
}

function trimRight(str) {
  var _len = str.length;
  var _i;
  var _result = new String(str);
  if (_len < 1) {
    return _result;
  }
  for (_i = 0; _i < _len; _i++) {
    if ((str.charCodeAt(_len - _i - 1) > 32) || (str.charCodeAt(_i) < -1)) {
      break;
    }
  }
  if (_i < 1) {
    return _result;
  }
  _result = _result.substring(0,_len - _i);
  return _result;
}

function trim(str) {
  var _result = trimLeft(str);
  if (_result.length > 0) {
    _result = trimRight(_result);
  }
  return _result;
}

function isBlank(str) {
  return (trimLeft(str) == "");
}

function getDaysInMonth(month,year) {
  if ((month < 1) || (month > 12)) {
    return 0;
  }
  var _daysInMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
  var _result = _daysInMonth[month - 1];
  if ((month == 2) && isLeapYear(year)) {
    _result++;
  }
  return _result;
}

function isInteger(n) {
  return (!isNaN(n) && (Math.ceil(n) == Math.floor(n)));
}

function isNatural(n) {
  return (isInteger(n) && (n >= 0));
}

function isLeapYear(year) {
if (year % 4 != 0) {
    return false;
  } else if (year % 400 == 0) {
    return true;
  } else if (year % 100 != 0) {
    return true;
  } else {
    return false;
  }
}

function isCorrectDate(year,month,day) {
  if (!isNatural(year) || !isNatural(month) || !isNatural(day)) {
    return false;
  }
  if ((year < 1) || (month < 1) || (month > 12) || (day < 1)) {
    return false;
  }
  var _daysInMonth = getDaysInMonth(month,year);
  if (day > _daysInMonth) {
    return false;
  }
  return true;
}

function checkInOutDates(outYear,outMonth,outDay,inYear,inMonth,inDay) {
  if (!isCorrectDate(outYear,outMonth,outDay)) {
    return "Incorrect from date " + outDay + "-" + outMonth + "-" + outYear;
  }
  if (!isCorrectDate(inYear,inMonth,inDay)) {
    return "Incorrect till date " + inDay + "-" + inMonth + "-" + inYear;
  }
  var msecPerDay = 24 * 60 * 60 * 1000;
  var currDT = new Date();
  currDT.setHours(0);
  currDT.setMinutes(0);
  currDT.setSeconds(0);
  currDT.setMilliseconds(0);
  var outDT = new Date(outYear,outMonth - 1,outDay);
  var inDT = new Date(inYear,inMonth - 1,inDay);
/*  if ((outDT.getTime() - currDT.getTime()) < msecPerDay) {
    return "Can not choose last and current date " + outDT.getDate() + "-" + (outDT.getMonth() + 1) + "-" + outDT.getYear();
  }
 */
  if ((inDT.getTime() - outDT.getTime()) < msecPerDay) {
    return "Till date must be less than From date";
  }
  if ((outDT.getTime() - currDT.getTime()) >= 331 * msecPerDay) {
    return "Can search not more than 331 from days forward";
  }
  if ((inDT.getTime() - currDT.getTime()) >= 331 * msecPerDay) {
    return "Can search not more than 331 from days forward";
  }
  return null;
}

/* end of miscfunctions */

		
function outDateChanged(theForm) {
  var outDT = new Date(theForm.outYear.options[theForm.outYear.selectedIndex].value,
    theForm.outMonth.options[theForm.outMonth.selectedIndex].value - 1,
    theForm.outDay.options[theForm.outDay.selectedIndex].value);
  var inDT = new Date(theForm.inYear.options[theForm.inYear.selectedIndex].value,
    theForm.inMonth.options[theForm.inMonth.selectedIndex].value - 1,
    theForm.inDay.options[theForm.inDay.selectedIndex].value);
  var msecPerDay = 24 * 60 * 60 * 1000;
  var currDT = new Date();
  currDT.setHours(0);
  currDT.setMinutes(0);
  currDT.setSeconds(0);
  currDT.setMilliseconds(0);

/*  if ((outDT.getTime() - currDT.getTime()) < msecPerDay) {
    return;
  }
*/
  if ((inDT.getTime() - outDT.getTime()) >= 2 * msecPerDay) {
    return;
  }
  inDT.setTime(outDT.getTime() + 1 * msecPerDay);
  theForm.inYear.selectedIndex = inDT.getFullYear() - theForm.inYear.options[0].value;
  theForm.inMonth.selectedIndex = inDT.getMonth();
  theForm.inDay.selectedIndex = inDT.getDate() - 1;
}

function doSearch(theForm) {
  var startPt = trim(theForm.From.value).toLowerCase();
  var endPt = trim(theForm.To.value).toLowerCase();
  if (startPt == "") {
    alert("Enter departer");
    theForm.From.focus();
    return false;
  }
  if (endPt == "") {
    alert("Enter destination");
    theForm.To.focus();
    return false;
  }
  if (startPt == endPt) {
    alert("Departer can not be equal to destination point");
    theForm.To.focus();
    return false;
  }
    theForm.DepartureDate.value =
    theForm.outDay.options[theForm.outDay.selectedIndex].value + '/'
    + theForm.outMonth.options[theForm.outMonth.selectedIndex].value + '/'
    + theForm.outYear.options[theForm.outYear.selectedIndex].value;
    theForm.ArrivalDate.value =
    theForm.inDay.options[theForm.inDay.selectedIndex].value + '/'
    + theForm.inMonth.options[theForm.inMonth.selectedIndex].value + '/'
    + theForm.inYear.options[theForm.inYear.selectedIndex].value;
  return true;
}


var ChldWnd;
var next;
var prev;
function initCalendar (act,m,p) {
  var wnd;
  if (!ChldWnd) {
    wnd = window.open ("about:blank", "wnd", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=368,height=172");
    ChldWnd = wnd;
  } else {
    wnd = ChldWnd;
  }

  var doc = wnd.document;
  var HTML_HEAD = '<html>\n' +
  '<head>\n' +
  '<title>Choose Date</title>\n' +
  '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n' +
  '<link rel="stylesheet" type="text/css" href="/calendar.css" />\n' +
  '</head>\n\n' +
  '<body>\n';
  var HTML_END = '</td>\n</tr>\n</table>\n\n</body>\n</html>\n';

  var CAL_1;
  var CAL_2;

  if (!p) {
    var nm = m;
    CAL_1 = setCalendar (act, m);
    CAL_2 = setCalendar (act, ++m);
    next = m;
    prev = nm;  
  } else {
    var nm = m;
    CAL_2 = setCalendar (act, m);
    CAL_1 = setCalendar (act, --m);
    next = nm;
    prev = m;
  }

  if (next <= 11) {
    var HREF_NEXT = '<a style="font-weight:bold;" href="javascript: self.opener.initCalendar('+ act + ',' + next +',0);"> &gt;&gt;</a>';
  } else {
    var HREF_NEXT = ' <u>&gt;&gt;</u>';
  }

  if (prev >= -11) {
    var HREF_PREV = '<a style="font-weight:bold;" href="javascript: self.opener.initCalendar('+ act + ',' + prev +',1);">&lt;&lt; </a>';  
  } else {
    var HREF_PREV = '<u>&lt;&lt;</u> ';
  }

  doc.open ();
  doc.writeln (HTML_HEAD);
  doc.writeln ("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">");
  doc.writeln ("<tr>");
  doc.writeln ("<td class=\"calArrL\">");
  doc.writeln (HREF_PREV);
  doc.writeln ("</td>");
  doc.writeln ("<td>&nbsp;</td>");
  doc.writeln ("<td class=\"calArrR\">");
  doc.writeln (HREF_NEXT);
  doc.writeln ("</td>");
  doc.writeln ("</tr>");
  doc.writeln ("<tr>");
  doc.writeln ("<td valign=\"top\">");
  doc.writeln ("");
  doc.writeln (CAL_1);
  doc.writeln ("</td>");
  doc.writeln ("<td>&nbsp;</td>");
  doc.writeln ("<td valign=\"top\">");
  doc.writeln ("");
  doc.writeln (CAL_2);
  doc.writeln (HTML_END);
  doc.close ();
}

function getTime () {
  var now = new Date();
  var hour = now.getHours();
  var minute = now.getMinutes();
  now = null;
  var ampm = "";

  if (hour >= 12) {
    hour -= 12;
    ampm = "PM";
  } else {
    ampm = "AM";
  }
  hour = (hour == 0) ? 12 : hour;

  if (minute < 10) {
    minute = "0" + minute;
  }
  return hour + ":" + minute + " " + ampm;
}

function leapYear (year) {
  if (year % 4 == 0) {
    return true;
  } else {
    return false;
  }
}

function getDays (month, year) {
  var ar = new Array (12);
  ar[0] = 31;
  ar[1] = (leapYear(year)) ? 29 : 28;
  ar[2] = 31;
  ar[3] = 30;
  ar[4] = 31;
  ar[5] = 30;
  ar[6] = 31;
  ar[7] = 31;
  ar[8] = 30;
  ar[9] = 31;
  ar[10] = 30;
  ar[11] = 31;
  return ar[month];
}

function getMonthName (month) {
  var ar = new Array (12);
  ar[0] = "Janvaris";
  ar[1] = "Februāris";
  ar[2] = "Marts";
  ar[3] = "Aprīlis";
  ar[4] = "Maijs";
  ar[5] = "Jūnijs";
  ar[6] = "Jūlijs";
  ar[7] = "Augusts";
  ar[8] = "Septembris";
  ar[9] = "Oktobris";
  ar[10] = "Novembris";
  ar[11] = "Decembris";
  return ar[month];
}

function setCalendar (act, dt) {
  var TABLE = "";
dateObj = new Date()
/*tmpMonth = dateObj.getMonth()
tmpYear = dateObj.getFullYear()
alert(dateObj);
alert(tmpMonth);
alert(tmpYear);*/

  var curdate = new Date();
  var month = curdate.getMonth();
  var year  = curdate.getYear();

  if(is.ns) {
    year += 1900
  }

  if (dt > 0) {
    var m = month + dt;
    if (m > 11) {
      month = m - 12;
      year ++;
    } else {
      month += dt;
    }
  }
  if (dt < 0) {
    var m = month + dt;
      if (m < 0) {
        month = 12 + m;
        year --;
      } else {
        month = m;
      }
  }

  var monthName = getMonthName(month);
  var days = getDays (month,year);
  var date = new Date (year,month,1);
  var day  = date.getDay ();

  TABLE = drawCalendar (monthName, year, month, day, days, act);
  return TABLE;
}

function drawCalendar (monthName, year, month, day, days, act) {
  var TABLE = "";
  TABLE += '<table cellpadding="2" cellspacing="1" border="0">\n';
  TABLE += '<tr class="calHead">\n';
  TABLE += '<td colspan="7">\n';
  TABLE += monthName + ', ' + year + '. gads';
  TABLE += '</td>\n';
  TABLE += '</tr>\n';

  var openCol = '<td class="calendar">';
  var closeCol = '</td>';

  var weekDay = new Array (7);
  weekDay[0] = "&nbsp;P&nbsp;";
  weekDay[1] = "&nbsp;O&nbsp;";
  weekDay[2] = "&nbsp;T&nbsp;";
  weekDay[3] = "&nbsp;C&nbsp;";
  weekDay[4] = "&nbsp;P&nbsp;";
  weekDay[5] = "&nbsp;S&nbsp;";
  weekDay[6] = "&nbsp;Sv&nbsp;";

  TABLE += '<tr class="calWeek">\n';
  for (var dayNum = 0; dayNum < 7; ++dayNum) {
    TABLE += openCol + weekDay[dayNum] + closeCol;
  }
  TABLE += '</tr>\n';

  var digit = 1;
  var curCell = 1;

  var d = new Date;
  var curr_day   = d.getDate();
  var curr_month = d.getMonth();
  var curr_year  = d.getYear();
  if(is.ns) {
    curr_year += 1900
  }
  if(day == 0 ){day = 7}
  for (var row = 1; row <= Math.ceil ((days + day -1) / 7); row ++) {
    TABLE += '<tr class="calTRBG">\n';
    for (var col = 0; col < 7; col++) {
      if (curCell < day) {
        TABLE += '<td class="calendar">&nbsp;</td>';
        curCell++;
      } else {
          if (days >= digit) { 
            if (curr_year < year) {
              TABLE += '<td class="calendar"><a href="#" onClick=self.opener.setParam(' + digit + ',' + month + ',' + year + ',' + act +');self.close();>' + digit + '</a></td>';
            } else {
		           if (curr_day == digit && curr_month == month && curr_year == year){
		        		TABLE += '<td class="currDate"><a href="#" onClick=self.opener.setParam(' + digit + ',' + month + ',' + year + ',' + act +');self.close();><b>' + digit + '</b></a></td>';
		        	}
              else if (curr_day > digit && curr_month >= month || curr_year > year) {
                TABLE += '<td class="calendar">' + digit + '</td>';
              } else if (curr_month > month) {
                TABLE += '<td class="calendar">' + digit + '</td>';
              } else {
                TABLE += '<td class="calendar"><a href="#" onClick=self.opener.setParam(' + digit + ',' + month + ',' + year + ',' + act +');self.close();>' + digit + '</a></td>';
              }
            }
          } else {
            TABLE += '<td class="calendar">&nbsp;</td>';
          }
          digit ++;
        }      
      /*{
        if (days >= digit) {      	       	 
          if (curr_year < year) {
            TABLE += '<td class="currDate"><a href="#" onClick=self.opener.setParam(' + digit + ',' + month + ',' + year + ',' + act +');self.close();>' + digit + '</a></td>';
          } else {
        	if (curr_day == digit && curr_month == month && curr_year == year){
        		TABLE += '<td class="currDate"><a href="#" onClick=self.opener.setParam(' + digit + ',' + month + ',' + year + ',' + act +');self.close();><b>' + digit + '</b></a></td>';
        	}           
           else if (curr_day > digit && curr_month > month || curr_year > year) {
            		TABLE += '<td class="calendar"><a href="#" onClick=self.opener.setParam(' + digit + ',' + month + ',' + year + ',' + act +');self.close();>' + digit + '</a></td>';
            }else if (curr_month > month) {
              TABLE += '<td class="calendar"><a href="#" onClick=self.opener.setParam(' + digit + ',' + month + ',' + year + ',' + act +');self.close();>' + digit + '</a></td>';
            } else {
              TABLE += '<td class="calendar"><a href="#" onClick=self.opener.setParam(' + digit + ',' + month + ',' + year + ',' + act +');self.close();>' + digit + '</a></td>';
            }
          }
        } else {
          TABLE += '<td class="calendar">&nbsp;</td>';
        }
        digit ++;
      }*/
    }
    TABLE += '</tr>\n';
  }

  TABLE += "</table>\n\n";
  return TABLE;
}

function setParam (day,month,year,act) {
	
  var form = window.document.filterForm;  
  switch (year) {
    /*case 2007:
    year = 0;
    break;*/
    
    case 2008:
    year = 0;
    break;
    case 2009:
    year = 1;
    break;
    case 2010:
    year = 2;
    break;
    case 2011:
    year = 3;
    break;
    case 2012:
    year = 4;
    break;    
  }
  if (act) {
    eval (form.outDay.options[day -1].selected=true);
    eval (form.outMonth.options[month].selected=true);
    eval (form.outYear.options[year].selected=true);
  } else {
    eval (form.inDay.options[day -1].selected=true);
    eval (form.inMonth.options[month].selected=true);
    eval (form.inYear.options[year].selected=true);
  }
}
function viewBigPict(pic,el){
	document.getElementById('big_'+el).src='/pic/'+pic;
}
function viewBig(pic){
	document.getElementById('big').src='/pic/'+pic;
}

function Delay(id){
  setTimeout('showDescr("'+id+'")',1000);
}
function showDescr(id){
	document.getElementById('descr_'+id).style.display='block';
}
function hideDescr(id){
	document.getElementById('descr_'+id).style.display='none';
}

/*
function showDecsr(id){
	document.getElementById('descr_'+id).style.display='block';
}
function hideDecsr(id){
	document.getElementById('descr_'+id).style.display='none';
}
function Delay(id){
  setTimeout('hideDecsr("'+id+'")',500);
}*/
function openImage(params) {
	if (!params) return;
	w = window.open("/popup.php"+params,"appWin","addressbar=0,toolbar=0,menubar=0,statusbar=0,scrollbars=1,resizable=1,width="+(screen.availWidth-150)+",height="+(screen.availHeight-100));
}
function openFlashMap(params) {
	if (!params) return;
	w = window.open("/popup.php"+params,"appWin","addressbar=0,toolbar=0,menubar=0,statusbar=0,scrollbars=1,resizable=1,width=650,height=850");
}
function showZoomBig(url) {
	window.open(url,'popupWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=1,width=800,height=600');
}
function showSpecialOffer(id){
	document.getElementById('special_offer_'+id).style.display='block';
}
/*
function showZoomBig(url) {
	window.open(url,'popupWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=1,width='+(screen.availWidth-250)+',height='+(screen.availHeight-100));
}
function openDescription(params){
	if (!params) return;
	w = window.open("/special.php"+params,"appWin","addressbar=0,toolbar=0,menubar=0,statusbar=0,scrollbars=1,resizable=1,width=300,height=300");	
}*/
function openDescription(url){
	window.open(url,"appWin","addressbar=0,toolbar=0,menubar=0,statusbar=0,scrollbars=1,resizable=1,width=420,height=595");	
}
function openForPrint(url){
	window.open(url,'appWin','addressbar=0,toolbar=0,menubar=0,statusbar=0,scrollbars=1,resizable=1,width='+(screen.availWidth-250)+',height='+(screen.availHeight-100));	
}