// (c)2011 MrOrange

function showProcessing(strMessage,strImage1,strImage2){var lFrame=frames['loadingFrame'];lFrame.startAnimation();var bodyElement=document.getElementById("mainDesign");var labelElement=lFrame.document.getElementById("searchLabel");if(labelElement!=null)
labelElement.innerHTML=strMessage;if(bodyElement!=null)
bodyElement.className="Filters_DisabledPage";var lFrameObject=new LayerFrame('loadingFrame');lFrameObject.show(((document.body.clientWidth-parseInt(lFrameObject.style.width))/2)+document.body.scrollLeft,((document.body.clientHeight-parseInt(lFrameObject.style.height))/2)+document.body.scrollTop);}
function LayerFrame(id){this.style=document.getElementById(id);this.hidden=true;this.show=function(x,y){this.style.left=x;this.style.top=y;this.hidden=false;}
this.hide=function(){this.style.top=-2000;this.hidden=true;}}
function breakOutOfFrames(){if(window!=top)
top.location.href=location.href;}
function redirect(strURL){document.location=strURL;}
function isNum(argvalue){argvalue=argvalue.toString();if(argvalue.length==0)
return false;for(var n=0;n<argvalue.length;n++)
if(argvalue.substring(n,n+1)<"0"||argvalue.substring(n,n+1)>"9")
return false;return true;}
function getWeekNumber(objDate){var Day,Month,Year,Hour,Minute,Second,today,d,Y_m,M_m,K,MJD_Now,MJD_Epoch,MJD_End,JD,Str_Var,WD,WN,W,WY
Hour=objDate.getHours();Minute=objDate.getMinutes();Second=objDate.getSeconds();Month=objDate.getMonth()+1;Day=objDate.getDate();Year=objDate.getYear();MJD_Now=ModifiedJulianDay(Year,Month,Day);W=Math.floor((MJD_Now/7)-2144.64);WD=((MJD_Now+2)%7)+1;WY=Math.floor((W*28/1461)-0.0079);WN=W-Math.floor((WY*1461/28)+0.41);return WN;}
function ModifiedJulianDay(Year,Month,Day){var today,d,Y_m,M_m,K,MJD,JD,decimal_time
d=367*Year-Div((7*(Year+(Div((Month+9),12)))),4)+Div((275*Month),9)+Day-730530;MJD=d+51543.0;return(MJD)}
function Div(a,b){return((a-a%b)/b)}
function DateAdd(startDate,numDays,numMonths,numYears)
{var returnDate=new Date(startDate.getTime());var yearsToAdd=numYears;var month=returnDate.getMonth()+numMonths;if(month>11)
{yearsToAdd=Math.floor((month+1)/12);month-=12*yearsToAdd;yearsToAdd+=numYears;}
returnDate.setMonth(month);returnDate.setFullYear(returnDate.getFullYear()+yearsToAdd);returnDate.setTime(returnDate.getTime()+60000*60*24*numDays);return returnDate;}
function YearAdd(startDate,numYears)
{return DateAdd(startDate,0,0,numYears);}
function MonthAdd(startDate,numMonths)
{return DateAdd(startDate,0,numMonths,0);}
function DayAdd(startDate,numDays)
{return DateAdd(startDate,numDays,0,0);}
function reloadPriceMatrix(strURL,strQueryString,objRef){if(strQueryString.length==0)
window.location.href=strURL+"?matrix_city1="+document.getElementById(objRef).value;else
window.location.href=strURL+"?"+strQueryString+"&matrix_city1="+document.getElementById(objRef).value;}
function OpenCarPopUp(URL){winInfo=window.open(URL,'Bil','width=450,height=250,scrollbars=1,resizable=1');}
function setCarDropdownValue(pickupcity,dropoffcity)
{document.getElementById(dropoffcity).value=document.getElementById(pickupcity).value}
function unCheckAllClasses(allClasses)
{document.getElementById(allClasses).checked=false;}
function ToggleNumberOfChildren(objNumOfAdults,objNumOfChildren){var childsAllowed=new Array(0,2,4,6,5,4,3,2,1);var selectedAdults=document.getElementById(objNumOfAdults).value;var selectedChildren=document.getElementById(objNumOfChildren).value;document.getElementById(objNumOfChildren).options.length=0;for(i=0;i<=childsAllowed[selectedAdults];i++){document.getElementById(objNumOfChildren).options[i]=new Option(i,i);}
document.getElementById(objNumOfChildren).value=selectedChildren;}
