 


// openWindow('site.html','sitename','10','mitten','100','100','yes');
function openWindow(site,name,left,top,width,height,scroll) {
	if (left=="mitten") {
		var varx = ((window.screen.width/2) - (width/2));
	}
	else {
		var varx = left;
	}
	if (top=="mitten") {
		var vary = ((window.screen.height/2) - (height/2));
	}
	else {
		var vary = top;
	}
	window.open(site,name,"width="+width+",height="+height+",left="+varx+",top="+vary+",location=no,toolbar=no,directories=no,status=no,scrollbars="+scroll+",resizable=yes,copyhistory=no,menubar=no");
}

// Open micro site
function openMicrosite() {
	if (check.b=="opera"){ height = 234; } else { height = 230; };
	openWindow("microsite.php","seewhy","mitten","mitten","420", height,"no");
}

// Green selectionbar
function view() {
	if (document.jump.city[document.jump.city.selectedIndex].value != "0") {
		changeCity();
	} else if (document.jump.lang[document.jump.lang.selectedIndex].value != "0") {
		changeLang();
	} else {
		changeSite();
	}
}
function changeSite() {
	if (document.jump.site.selectedIndex > 1) {
		top.location.href = document.jump.site[document.jump.site.selectedIndex].value;
	}
}
function changeLang() {
	if (document.jump.lang.selectedIndex > 1) {
		top.location.href = "loc_" + document.jump.lang[document.jump.lang.selectedIndex].value + ".php";
	}
}
function changeCity() {
	if (document.jump.lang.selectedIndex > 1 && document.jump.city.selectedIndex > 1) {
		top.location.href = "loc_" + document.jump.lang[document.jump.lang.selectedIndex].value + "_" + document.jump.city[document.jump.city.selectedIndex].value + ".php";
	}
}

// Check fields on booking page
function check_fields() {
	a = [document.book.name.value,document.book.email.value,document.book.tel.value,document.book.country.value,document.book.language.value,document.book.duration.value,document.book.level.value,document.book.intensity.value,document.book.intensity2.value,document.book.living.value,document.book.living2.value,document.book.multiloc.value,document.book.comments.value];
	if (a[0] != "" && a[1] != "") {
		document.book.submit();
	}
	else {document.location="contact_book.php?error=1&a="+a[0]+"&b="+a[1]+"&c="+a[2]+"&d="+a[3]+"&e="+a[4]+"&f="+a[5]+"&g="+a[6]+"&h="+a[7]+"&i="+a[8]+"&j="+a[9]+"&k="+a[10]+"&l="+a[11]+"&m="+a[12]}
}

// Check fields in Tell-a-friend
function check_fields_tell(i) {
	a = [document.tell.email.value,document.tell.email2.value];
	// "Your e-mail..." and "Friends e-mail..." must be changed to resemble specific country's spelling
	if (a[0] != "" && a[1] != "" && a[0] != "Your e-mail address" && a[1] != "Friends e-mail address") {
		document.tell.submit();
	}
	else {document.location=i+"?error2=1&tell1="+a[0]+"&tell2="+a[1]}
}

// Check fields on contacts page
function check_fields_contact() {
	a = [document.mess.name.value,document.mess.email.value,document.mess.tel.value,document.mess.comments.value];
	if (a[0] != "" && a[1] != "") {
		document.mess.submit();
	}
	else {document.location="contact.php?error=1&a="+a[0]+"&b="+a[1]+"&c="+a[2]+"&d="+a[3]}
}
