function nextImage() {
	currentIndex++;
	if (currentIndex > maxIndex) {
		currentIndex = 0;
	}
	setProspectImage(currentIndex);
}

function previousImage() {
	currentIndex--;
	if (currentIndex < 0) {
		currentIndex = maxIndex;
	}
	setProspectImage(currentIndex);
}

function setProspectImage(index) {
	currentIndex = index;
	document.images["prospectImage"].src = imageArray[currentIndex];
}

function validateInspectionForm()
{
	form=document.inspection;
	
	if (!form.firstname.value.length>0) 
	{
		alert("Du må fylle inn fornavn!");
		form.firstname.focus();
		return false;
	}
	
	if (!form.lastname.value.length>0) 
	{
		alert("Du må fylle inn etternavn!");
		form.lastname.focus();
		return false;
	}
	
	if (!form.address.value.length>0) 
	{
		alert("Du må fylle inn adresse!");
		form.address.focus();
		return false;
	}
		
	if (!form.phone.value.length>0) 
	{
		alert("Du må fylle inn telefon!");
		form.phone.focus();
		return false;
	}
	if (!form.email.value.length>0) 
	{
		alert("Du må fylle inn email!");
		form.email.focus();
		return false;
	}
	return true;
}

function validateSeminarForm()
{
	form=document.inspection;
	
	if (!form.firstname.value.length>0) 
	{
		alert("Du må fylle inn fornavn!");
		form.firstname.focus();
		return false;
	}
	
	if (!form.lastname.value.length>0) 
	{
		alert("Du må fylle inn etternavn!");
		form.lastname.focus();
		return false;
	}
	
	if (!form.address.value.length>0) 
	{
		alert("Du må fylle inn adresse!");
		form.address.focus();
		return false;
	}
		
	if (!form.phone.value.length>0) 
	{
		alert("Du må fylle inn telefon!");
		form.phone.focus();
		return false;
	}
	if (!form.email.value.length>0) 
	{
		alert("Du må fylle inn email!");
		form.email.focus();
		return false;
	}
	if (!form.participants.value.length>0) 
	{
		alert("Du må fylle inn antall deltakere!");
		form.participants.focus();
		return false;
	}
	return true;
}

function setFocus() {
	document.inspection.firstname.focus();
}

function openVirtualTour(theURL,winName,features) { 
	window.open(theURL,winName,features);
}

function openLink(theURL,winName) { 
	window.open(theURL,winName,'width=770, height=600, resizable=yes, scrollbars=yes, menubar=yes, titlebar=yes, status=yes, left=50, toolbar=yes, location=yes');
}

function openPDF(theURL,winName) { 
	window.open(theURL,winName,'width=750, height=600, resizable=yes, scrollbars=yes, titlebar=yes, status=yes, left=50');
}

function getURLSunsearch() {
	url = document.URL;
	target = '<a href="' + url + '"';
	target = target + 'onclick="openLink(';
	target = target + "'http://www.sunsearch.info/alanya/norwegian/', '')";
	target = target + '"><b>Sunsearch.info&nbsp;&raquo;</b></a>';
	return target;
}

function getURL2Base() {
	url = document.URL;
	target = '<a href="' + url + '"';
	target = target + 'onclick="openLink(';
	target = target + "'http://www.2base.com/tyrkia/', '')";
	target = target + '">';
	return target;
}

function getURLANSA() {
	url = document.URL;
	target = '<a href="' + url + '"';
	target = target + 'onclick="openLink(';
	target = target + "'http://www2.ansa.no/default.asp?id=6795', '')";
	target = target + '">';
	return target;
}

function getURLBjorknes() {
	url = document.URL;
	target = '<a href="' + url + '"';
	target = target + 'onclick="openLink(';
	target = target + "'http://www.worldwide.bjorknes.no/?module=Articles;action=ArticleFolder.publicOpenFolder;ID=574', '')";
	target = target + '">';
	return target;
}