/*##################################################*/
function show_tour_calendar() {
/*##################################################*/
	var w = '900' ;
	var h = '450' ;
	var winl = (screen.availWidth - w) / 2;
	var wint = (screen.availHeight - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizeable=no';
	win = window.open('http://www.motoaventures.com/calendar.php', '_new', winprops);
 
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
/*##################################################*/
function show_applic() {
/*##################################################*/
	var w = '850' ;
	var h = '600' ;
	var winl = (screen.availWidth - w) / 2;
	var wint = (screen.availHeight - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizeable=no';
	win = window.open('http://www.motoaventures.com/application/', '_new', winprops);
 
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
/*##################################################*/
function show_terms(id) {
/*##################################################*/
	var w = '850' ;
	var h = '600' ;
	var winl = (screen.availWidth - w) / 2;
	var wint = (screen.availHeight - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizeable=no';
	win = window.open('show_terms.php?id='+id, '_new', winprops);
 
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
/*##################################################*/
function show_cb() {
/*##################################################*/
	var w = '800' ;
	var h = '600' ;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizeable=no';
	win = window.open('http://www.motoaventures.com/charley_boorman.php', '_new', winprops);
 
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
/**********************************************************/
function createCookie(name,value,expKey,expVal) {
/**********************************************************/

	if (expKey == 'd') {
		var date = new Date();
		date.setTime(date.getTime()+(expVal*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}else if (expKey == 'h') {
		var date = new Date();
		date.setTime(date.getTime()+(expVal*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}else if (expKey == 'm') {
		var date = new Date();
		date.setTime(date.getTime()+(expVal*60*1000));
		var expires = "; expires="+date.toGMTString();
	}else if (expKey == 's') {
		var date = new Date();
		date.setTime(date.getTime()+(expVal*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else if (expKey == '-1') {
		var date = new Date();
		date.setTime(date.getTime()-(expVal*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}else{
		var expires = "";
	}
	document.cookie = name+"="+value+expires+"; path=/";
}
/**********************************************************/
function readCookie(name) {
/**********************************************************/
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0){
			return unescape(c.substring(nameEQ.length,c.length));
		}
	}
	return null;
}
/**********************************************************/
function eraseCookie(name) {
/**********************************************************/
	createCookie(name,'','-1');
/*	window.location.reload();	*/
}

