PageSourceSearch

https://avis.si/avisonline/qs-gb/avis.nsf/MainFunctions.js

js avis.si collected 2026-10-07 20:16:08 UTC 11,420 bytes, 369 lines download raw bytes

1function loadCountry( iURL)
2{
3    if(location.href.charAt(5) == ":")
4        parent.location.href="https://" + iURL;
5    else
6       parent.location.href="http://" + iURL;
7}
8function DiffDays(S1, S2) {
9  var aDate = new Array();
10  aDate = S1.split(".")
11  var D1 = new Date(parseInt(aDate[2], 10), parseInt(aDate[1], 10)-1, parseInt(aDate[0], 10), 0,0,0);
12 
13  aDate = S2.split(".")
14  var D2 = new Date(parseInt(aDate[2], 10), parseInt(aDate[1], 10)-1, parseInt(aDate[0], 10), 0,0,0);
15 
16  return Math.round((D1 - D2) / 86400000);
17}
18function setETTDay()
19{
20  var xF = document.forms[0];
21  var startMonthYear = xF.ETAMonth[xF.ETAMonth.selectedIndex].value;
22  var endMonthYear = xF.ETTMonth[xF.ETTMonth.selectedIndex].value;
23  var DayLoaded = document.getElementsByName('ETADayLoaded').item(0).value;
24// ETA DAY, MONTH, YEAR
25  var sDay = Number( xF.ETADay[xF.ETADay.selectedIndex].value );
26  var sMonth = Number( startMonthYear.substr(0,2) );
27  var sYear = Number( startMonthYear.substr(2,4) );
28// ETT DAY, MONTH, YEAR
29  var eDay = Number( xF.ETTDay[xF.ETTDay.selectedIndex].value );
30  var eMonth = Number( endMonthYear.substr(0,2) );
31  var eYear = Number( endMonthYear.substr(2,4) );
32  // Get the difference between day end - day start. Day start is set in field ETADayLoaded
33  var xOffset = DiffDays( eDay+ "."+eMonth+"."+eYear, DayLoaded);
34// update ETADayLoaded value
35  document.getElementsByName('ETADayLoaded')[0].value = sDay+"."+sMonth+"."+sYear;
36// Max number of days in selected start Month
37  var MaxDays = 31;
38  if(sMonth==4 ||sMonth==6 || sMonth==9 || sMonth==11 )
39  {
40      MaxDays = 30;
41  }
42  if(sMonth==2)
43  {
44    MaxDays = 28;
45    if(sYear%4==0)  MaxDays = 29;
46    if(sYear%100==0) MaxDays = 28;
47    if(sYear%400==0) MaxDays = 29;
48  }
49// Set start day to the last day of the start month, if selected day > max days
50  if( sDay > MaxDays )
51  {
52    sDay = MaxDays;
53    xF.ETADay.selectedIndex = MaxDays - 1;
54  }
55// calculate Offset 
56if( xOffset < 0) 
57  Diff =  xOffset + MaxDays ;
58else
59  Diff = xOffset;
60// Add Offset to the Start date
61  var startDateNew = sDay + "." + sMonth + "." + sYear
62  var newEndDate = getNextDate( startDateNew, Diff )
63  var oNewEndDate = new Array();
64  oNewEndDate = newEndDate.split(".");
65 
66  var newEndDay = oNewEndDate[0];
67  var newEndMonth = oNewEndDate[1];
68  var newEndYear = oNewEndDate[2];
69  xF.ETTDay.selectedIndex = newEndDay - 1;
70  setMonthYear( xF.ETTMonth, newEndMonth + '' + newEndYear);
71// set opening hours for ETA and ETT
72  setOpeningHours('ETA');
73  setOpeningHours('ETT');
74}
75// Calender Picker
76var opener_feld = "";
77function getDate() 
78{
79    var datum = new Date();
80    var h_jahr = datum.getFullYear();
81    var h_monat = datum.getMonth()+1;
82    var h_tag = datum.getDate();
83}
84
85// MIt Hilfe dieser Funktion wird das Datum an den Opener übermittlelt
86function setOpenerDatum(tag, monat, jahr) 
87{
88     var xF = document.forms['quickbooking'];
89    xF.elements[opener_feld + "Day"].selectedIndex = (tag -1);
90    xF.elements[opener_feld + "Month"].selectedIndex = (monat -1);
91//    xF.elements[opener_feld + "Year"].value = jahr
92}
93/*
94function openKalender(of, iCalendarPickerURL) 
95{
96    opener_feld = of;
97    xWin = window.open(iCalendarPickerURL,'', 'width=200,height=230,left=30,screenX=30,top=30,screenY=30,resizable=no');	
98    if( xWin) xWin.focus();
99}
100function mouseover( e )
101{
102  if (statusinfo == false) status='';
103  return true;
104}
105if (window.Event) // Navigator 4.0x
106  document.captureEvents(Event.MOUSEOVER);
107document.onmouseover = mouseover;
108*/
109function getListValue( option_object  )
110{
111  if(  option_object )
112	return option_object[ option_object.selectedIndex ].value;
113  else
114	return'';
115}
116function getDivValue( pId  )
117{
118	var oElem = document.getElementById( pId); 
119	var returnValue = '';
120
121  if( oElem )
122		returnValue = oElem.getAttribute('valueselected');
123	if( returnValue == null )
124		returnValue = '';
125	return returnValue;
126}
127function setListValue( option_object, value  )
128{
129 option_object.selectedIndex = value;
130}
131// GET NEXT DATE
132function getNextDate(pEndDate, pAddDays)
133{
134  var aDate = new Array();
135  aDate = pEndDate.split(".");
136 
137  var oDate = new Date( parseInt(aDate[2], 10), (parseInt(aDate[1], 10)-1), parseInt(aDate[0], 10), 0, 0, 0);
138  oDate.setDate(oDate.getDate()+pAddDays)  
139 
140  return strright("00" + oDate.getDate(), 2) + "." + strright("00" + (oDate.getMonth()+1), 2) + "." + oDate.getFullYear();
141}
142function strright( xVal, xNr)
143{
144  return xVal.substr(xVal.length - xNr, xNr);
145}
146function deleteCookieValue( iParam ) 
147{
148	var expires = new Date();
149	var expiryDate = 'Wednesday, 07-Jan-04 23:59:59 GMT';
150 	var xParamString =  iParam + ';expires='+ expiryDate + ';domain=' + cookiedomain + ';path=/';
151 	document.cookie= xParamString;
152}
153function deletePersonalDataCookie( iParam )
154{
155	deleteCookieValue( iParam );
156	//delete cookie to in other booking domain
157	var xDIV = document.getElementById('RM');
158	if( xDIV )
159		xDIV.style.display='none';
160	document.frames['RemoveCookie'].location.href=xIFrameURL ;
161}
162// ============== SEARCH =============
163// open station search window
164function openSearchform( target , country)
165{
166    var xF = document.forms[0];
167    var xElement = null;
168    var xCountry = "";
169    var URL = "";
170    var win = null;
171    var xBox = "";
172    
173    var xCountryField = document.getElementById('Country'); //getValue("Country");
174    if( gCTMST.length >0 )
175	var xMST = gCTMST;
176    else
177	var xMST = '&MST=' + gMst;
178    if( xCountryField )
179    {
180      var xCountry = xCountryField.getAttribute('valueselected');
181      xURL = gStationsURL + '/Searchform?openform&Country=%COUNTRY%&Target=%TARGET%&Type=3' + '&Lng=' + gLng + '&Ctr=' + gCtr + '&IBEOwner=' + gCtr +  xMST;
182    
183      xURL = xURL.replace( /%TARGET%/, target).replace( /%COUNTRY%/, xCountry );
184      win = window.open( xURL, 'Stationfinder', "width=700,height=600, resizable=yes, scrollbars=yes, status=yes");
185      win.focus(); 
186    }
187}
188 
189// open fleet seach window 
190function openFleetSearch( target )
191{
192    var win = null;
193    
194    var xCountryField = document.getElementById('Country'); //getValue("Country");
195    if( gCTMST.length >0 )
196	var xMST = gCTMST;
197    else
198	var xMST = '&MST=' + gMst;
199    if( xCountryField )
200    {
201      var xCountry = xCountryField.getAttribute('valueselected'); 
202      xURL = gFleetURL + '/ShowFleetIntl?readform&Country=%COUNTRY%&Type=Popup' + '&Lng=' + gLng + '&Ctr=' + gCtr + '&IBEOwner=' + gCtr +  xMST+ '&STA=' + gSelectedSTA;
203      xURL = xURL.replace( /%COUNTRY%/, xCountry );
204      win = window.open( xURL, 'Fleetfinder', "width=650,height=400, resizable=yes, scrollbars=yes, status=yes");
205      win.focus(); 
206    }
207}
208 
209//This function is called from popup window to set the selected station
210function selectStationSTA( _Station, _Target)
211{
212    var StationsHtml = '';
213    var TargetElement;
214    var StationName = '';
215    // get div which displays the selected station to the user  
216    TargetElement = document.getElementById( _Target );
217    // get the complete html code containing stations from a hidden textarea
218    StationsHtml = document.getElementById( _Target + 'List' );
219    if( StationsHtml )
220    {    
221        StationName 	= parseNameFromHTML( StationsHtml, _Station );
222    }
223    if( TargetElement ) 	
224    {
225      TargetElement.innerHTML = StationName;
226      TargetElement.setAttribute('valueselected', _Station);
227      if( _Target == "STA")
228      {
229         TargetElement = document.getElementById( 'ILC' );
230         {
231            TargetElement.innerHTML = StationName;
232            TargetElement.setAttribute('valueselected', _Station);
233         }
234       }
235    }
236}
237 
238function parseNameFromHTML( _FieldHtml, _Id )
239{
240  var aHTML = new Array();
241  var aTemp1 = new Array();
242  var aTemp2 = new Array();
243  var i=0;
244  var found = false;
245  var elementId = '';
246  var elementName = '';
247  var foundName = '';
248  if( _FieldHtml )
249  {
250    aHTML = _FieldHtml.value.split('</td></tr>');
251   // get name using station id
252    while( (i < aHTML.length) && (found == false))
253    {
254        aTemp1 = aHTML[i].split( 'id="' );
255        if( aTemp1[1] )
256        {    
257       //get name
258          aTemp2 = aTemp1[1].split( '>' );
259          elementName = aTemp2[1];
260       //get id
261          aTemp2 = aTemp1[1].split( '"' );
262	  elementId = aTemp2[0];
263 	 // compare ids
264	 if( elementId == _Id )
265	 {
266	   found = true;
267	   foundName = elementName;
268	 }
269        }
270	i++;
271    }
272  }
273  return foundName;
274}
275function setGroup( _Group)
276{
277    var CarsHtml = '';
278    var TargetElement;
279    var CarName = '';
280    // get div which displays the selected station to the user  
281    TargetElement = document.getElementById( 'GRP1' );
282    // get the complete html code containing stations from a hidden textarea
283    CarsHtml = document.getElementById( 'GRP1List' );
284    if( CarsHtml )
285    {    
286        CarName = parseNameFromHTML( CarsHtml, _Group );
287    }
288    if( TargetElement ) 	
289    {
290      TargetElement.innerHTML = CarName;
291      TargetElement.setAttribute('valueselected', _Group);
292    }
293}
294 
295//this function replaces the domino generated refresh function if option "Refresh field on keyword change" is activated
296function getValue( iFieldname)
297{
298    var xF = document.forms[0];
299    if( iFieldname == 'ETA' || iFieldname == 'ETT')
300    {
301        if( xF.elements[ iFieldname + 'Day'] )
302        {
303            var day1 = (xF.elements[ iFieldname + 'Day'].options[ xF.elements[ iFieldname+ 'Day'].selectedIndex].value); 
304            var month1 = (xF.elements[ iFieldname + 'Month'].options[ xF.elements[ iFieldname+ 'Month'].selectedIndex].value); 
305            var year1 = (xF.elements[ iFieldname + 'Year'].options[ xF.elements[ iFieldname+ 'Year'].selectedIndex].value); 
306            var hour1 = (xF.elements[ iFieldname + 'Hour'].options[ xF.elements[ iFieldname+ 'Hour'].selectedIndex].value); 
307            var min1 = (xF.elements[ iFieldname + 'Minute'].options[ xF.elements[ iFieldname+ 'Minute'].selectedIndex].value); 
308            return( day1 + "-" + month1 +  "-" + year1 +  "-" + hour1 +  "-" + min1);
309        }
310    }
311    else
312    {
313        if( xF.elements[ iFieldname].type=='select-one')
314        {
315            return(xF.elements[ iFieldname].options[ xF.elements[ iFieldname].selectedIndex].value); 
316        }
317        else if( xF.elements[ iFieldname].type=='checkbox')
318        {
319             if( xF.elements[ iFieldname].checked)
320                    return( xF.elements[ iFieldname].value);
321             else
322                    return("");
323         }
324         else
325         {
326            return( xF.elements[ iFieldname].value);
327         }
328    }
329}
330 
331function fullsizeIFRAME(iframeName) 
332{
333	var obj = document.getElementById(iframeName);
334 
335	if(obj)
336	{
337		if (obj.contentWindow)  // check to see if the browser is IE5.5
338		{
339			if (obj.contentWindow.document) 
340			{
341				var doc = obj.contentWindow.document;
342				if (doc.body) // check a document isn't being loaded to avoid errors
343				{
344					obj.height = doc.body.scrollHeight;
345					obj.msg = doc.getElementById('RM').innerHTML;
346				}
347			}
348		}
349		else if (obj.document)  // IE5.0
350		{
351			if (frames[iframeName].document.body) // check for transition / refresh
352			{
353				obj.height = frames[iframeName].document.body.scrollHeight;
354				obj.msg = frames[iframeName].document.getElementById('RM').innerHTML;
355			}
356		}
357	
358		if(obj.msg.length > 30) 
359		{
360			obj.height = 15; 
361		}
362		else 
363		{
364			obj.height = 0;
365			if(document.getElementById('welcomeMessage'))
366				document.getElementById('welcomeMessage').style.height = 0;
367		}
368	}
369}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.