// JavaScript for Change URL

function adaString(haystack, needle, offset) {
 
    var i = (haystack+'').indexOf(needle, (offset ? offset : 0));
    return i === -1 ? false : true;
}

function changeUrlDir(dir){
	var current_url = document.location +"";
	
	if (adaString(current_url, '/en/'))
		var new_url = current_url.replace("/en/", dir);
	if (adaString(current_url, '/jp/'))
		var new_url = current_url.replace("/jp/", dir);
	if (adaString(current_url, '/ru/'))
		var new_url = current_url.replace("/ru/", dir);
	
	if(new_url)
		document.location = new_url;
}

function openNewWindow() {
 popupWin = window.open('https://beta.yourreservation.net/ibe/HUDPSVB/main.html', 'open_window', 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=1024, height=650, left=0, top=0')
}