	 /* addtoBookmarks - add url to bookmarks/favorites list
	    
	    @param    string        url     url of page
	    @param    string        title   title page
	 */
				  
	function addtoBookmarks( url, title )  
	{ 
		var urlRegxp = /^(http:\/\/www.|https:\/\/www.|www.){1}([\w]+)(.[\w]+){1,2}[A-Za-z0-9-_%&\?\/.=]+$/;
		// /^(http:\/\/www.|https:\/\/www.|ftp:\/\/www.|www.){1}([\w]+)(.[\w]+){1,2}$/;
		var msg = '';
		msg = msg + '\n url is ' + url;
		msg = msg + '\n title is ' + title;
		//alert (msg );
		
		if ( url == '' || ! urlRegxp.test( url ) || title == '' )
		{
			url = "http://www.cheapbeep.co.uk";
			title = "Cheap Beep - The Home Of The Best UK Car & Van Rental Deals On The Web!";
		}
		
		if ( ( navigator.appName == "Microsoft Internet Explorer" ) && ( parseInt( navigator.appVersion ) >= 4 ) ) 
		{
			window.external.AddFavorite( url, title ); 
		}
		else if (navigator.appName == "Netscape")
		{
			window.sidebar.addPanel( title, url, "" );
		}
		else
		{
			alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
		}
		
	} // end of function: addtoBookmark

	/*  setResDates - sets reservation dates (e.g. DATECO.day/month/year) DATECI.day/month/year on a given form
	 *
	 *   @param    object        frm     document form control (e.g. document.thform )
    	 */
	function setResDates( frm )
	{
		var now = new Date();           // todays date
		var addTwo = now.getDate();     // increment by 2 days
		var coday, comonth, coyear, ciday, cimonth, ciyear;
		var msg = '';
		
		addTwo=addTwo+2;
		now.setDate( addTwo );

		// calc lasp time
		var laps = Date.UTC( y2k( now.getYear() ),( now.getMonth() ),( now.getDate() + 2 ),0,0,0 );
		var retour = new Date( laps );

		// set date values
		coday = now.getDate();
		ciday = retour.getDate();
		comonth = now.getMonth()+1;
		cimonth = retour.getMonth()+1;
		coyear = y2k( now.getYear() );
		ciyear = y2k( retour.getYear() );

		// if less than 10 prefix day with 0
		if ( coday < 10 ) { coday="0" + coday }
		if ( ciday < 10 ) { ciday="0" + ciday }

		// if less than 10 prefix month with 0
		if ( comonth < 10 ) { comonth="0" + comonth }
		if ( cimonth < 10 ) { cimonth="0" + cimonth }

		// debug
		msg = msg + '\n checkout day is ' + coday;
		msg = msg + '\n checkin day is ' +  ciday;
		msg = msg + '\n checkout month is ' + comonth;
		msg = msg + '\n checkin month is ' + cimonth;
		msg = msg + '\n checkout year is ' + coyear;
		msg = msg + '\n checkin year is ' + ciyear;
		// alert  ( msg );

		// update form
		frm.elements['DATECO.day'].value = coday;
		frm.elements['DATECI.day'].value=ciday;
		frm.elements['DATECO.month'].value=comonth;
		frm.elements['DATECI.month'].value=cimonth;
		frm.elements['DATECO.year'].value=coyear;
		frm.elements['DATECI.year'].value=ciyear;
		
	} // end function: setResDates


	    function updateRet( frm )
	    {
	    	// get pickup date elements
		var pickupDay = frm.elements['DATECO.day'].value;
		var pickupMonth = frm.elements['DATECO.month'].value;
		var pickupYear = frm.elements['DATECO.year'].value;

		pickupMonth--;          // decrement month
		var retDate = new Date( pickupYear,pickupMonth,pickupDay );

		addTwo = retDate.getDate();
		addTwo = addTwo+2;
		retDate.setDate(addTwo);
		
		var monthChange = retDate.getMonth();
		monthChange++;      // increment month
		
		// if less than 10 prefix month with 0
		if ( monthChange < 10 ) {   monthChange="0" + monthChange }
		
		var dayChange = retDate.getDate();
		
		// if less than 10 prefix day with 0
		if ( dayChange < 10 ) { dayChange="0" + dayChange }
		
		frm.elements['DATECI.day'].value = dayChange;
		frm.elements['DATECI.month'].value = monthChange;
		frm.elements['DATECI.year'].value = retDate.getFullYear();
		
	} // end function: updateRet
		
