function updateDate() {
	var origin = document.forms['frmNationalSelect'].Origin.value;
	var destination = document.forms['frmNationalSelect'].Destination.value;

	var date = document.forms['frmNationalSelect'].tickets_date.value;
	var month = document.forms['frmNationalSelect'].tickets_month.value;
	var year = document.forms['frmNationalSelect'].tickets_year.value;

	document.getElementById('Date').value = date + '-' + month + '-' + year;

	document.forms['frmNationalSelect'].action = 'https://194.106.151.95/asp/NationalList.asp?Origin=' + origin + '&Destination=' + destination + '&Date=' + date + '-' + month + '-' + year;
}

var postitNote = 1;

function prevNote() {
	// if browser doesn't support this method, return false
	if(!document.getElementById) return false;

	var hideMe = document.getElementById('news_article' + postitNote);
	hideMe.style.display='none';

	postitNote = postitNote - 1;

	if(postitNote == 0) {
		postitNote = postitTotal;
	}

	var showMe = document.getElementById('news_article' + postitNote);
	showMe.style.display='block';
}

function nextNote() {
	// if browser doesn't support this method, return false
	if(!document.getElementById) return false;

	var hideMe = document.getElementById('news_article' + postitNote);
	hideMe.style.display='none';

	postitNote = postitNote + 1;

	if(postitNote > postitTotal) {
		postitNote = 1;
	}

	var showMe = document.getElementById('news_article' + postitNote);
	showMe.style.display='block';
}

var tweetNote = 1;

function prevTweet() {
	// if browser doesn't support this method, return false
	if(!document.getElementById) return false;

	var hideMe = document.getElementById('tweet_article' + tweetNote);
	hideMe.style.display='none';

	tweetNote = tweetNote - 1;

	if(tweetNote == 0) {
		tweetNote = tweetTotal;
	}

	var showMe = document.getElementById('tweet_article' + tweetNote);
	showMe.style.display='block';
}

function nextTweet() {
	// if browser doesn't support this method, return false
	if(!document.getElementById) return false;

	var hideMe = document.getElementById('tweet_article' + tweetNote);
	hideMe.style.display='none';

	tweetNote = tweetNote + 1;

	if(tweetNote > tweetTotal) {
		tweetNote = 1;
	}

	var showMe = document.getElementById('tweet_article' + tweetNote);
	showMe.style.display='block';
}

function urlencode (str) {
    str = (str+'').toString();
    return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
}

function hideAll() {
	// if browser doesn't support this method, return false
	if(!document.getElementById) return false;

	for(i = 1; i <= option; i++) { //option can be found as a global variable in header_02.php
		var hide = document.getElementById('sub' + i);
		if(hide != null) {
			hide.style.display='none';
		}

		var menu = document.getElementById('menu_item' + i);
		menu.className='';
	}
}

function show(x) {
	// if browser doesn't support this method, return false
	if(!document.getElementById) return false;

	var menu = document.getElementById('menu_item' + x);
	menu.className='selected';

	var showme = document.getElementById('sub' + x);
	showme.style.display='block';
}