// Window status...

function windowStatus() {
	window.status = "Lotus Luxury Tours"; return true;
}

//###


// Rolling images...

function imgRollover(imgId,imgFolder,imgName,imgType) {
	document.getElementById(''+imgId+'').src = 'images/'+imgFolder+'/'+imgName+'-1.'+imgType+'';
}

function imgRollout(imgId,imgFolder,imgName,imgType) {
	document.getElementById(''+imgId+'').src = 'images/'+imgFolder+'/'+imgName+'-0.'+imgType+'';
}

//###


// Search form (category selection)...

var previousOption = '1';

function catHighlight(radioDiv) {
	document.getElementById('sc'+previousOption+'').style.backgroundColor = '#F5EE50';
	document.getElementById('sc'+previousOption+'').style.color = '#6E71C9';

	document.getElementById('sc'+radioDiv+'').style.backgroundColor = '#62D752';
	document.getElementById('sc'+radioDiv+'').style.color = '#FFF';

	previousOption = radioDiv;
}

//###


// Search form (combine selection)...

var previousCom = '1';

function comHighlight(radioCom) {
	document.getElementById('ssl'+previousCom+'').style.fontWeight = 'normal';
	document.getElementById('ssl'+previousCom+'').style.color = '#6E71C9';

	document.getElementById('ssl'+radioCom+'').style.fontWeight = 'bold';
	document.getElementById('ssl'+radioCom+'').style.color = '#62D752';

	previousCom = radioCom;
}

//###


// Search form (visual focus)...

function searchFocus(thisField) {
	document.getElementById(''+thisField+'').style.backgroundColor = '#3E43B7';
	document.getElementById(''+thisField+'').style.border = '1px solid #EBE556';
	document.getElementById(''+thisField+'').style.color = '#FFF';
}

function searchBlur(thisField) {
	document.getElementById(''+thisField+'').style.backgroundColor = '#FFF';
	document.getElementById(''+thisField+'').style.border = '1px solid #CFD1ED';
	document.getElementById(''+thisField+'').style.color = '#3E43B7';
}

//###


// Contact form (visual focus)...

function contactFocus(thisField) {
	document.getElementById(''+thisField+'').style.backgroundColor = '#FCFBD3';
	document.getElementById(''+thisField+'').style.color = '#3E43B7';
}

function contactBlur(thisField) {
	document.getElementById(''+thisField+'').style.backgroundColor = '#FFF';
	document.getElementById(''+thisField+'').style.color = '#6E71C9';
}

//###


// Contact form (send button rollover)...

function mOver() {
	document.getElementById('c-send').style.backgroundColor = '#62D752';
}

function mOut() {
	document.getElementById('c-send').style.backgroundColor = '#3E43B7';
}

//###


// Results table (row hightlight)...

function rsHighlight(row) {
	document.getElementById('rr'+row+'').style.backgroundColor = '#CFD1ED';
	document.getElementById('rr'+row+'').style.cursor = 'pointer';
}

function rsLowlight(row,num) {
	if (num == 1) {
		document.getElementById('rr'+row+'').style.backgroundColor = 'transparent';
	}
	else {
		document.getElementById('rr'+row+'').style.backgroundColor = '#FAF6A7';
	}
}

//###


// Results form (new search display)...

function nsOn() {
	document.getElementById('new-search').style.display = 'block';
}

function nsOff() {
	document.getElementById('new-search').style.display = 'none';
}

//###


// Photo directory (transparency and cycle effect)...

var photoTotal = 9; // This value's obtained from the number of photos uploaded for the currently viewed holiday, resort or hotel...

function photoTransparency() {
	if (photoTotal > 1) { // For the cycle to initiate, there needs to be more than one photo uploaded...
		for (i=1; i<=photoTotal; i++) { // If so, this loop sets the opacity of all photos in the directory to 50%...
			if (navigator.appName == 'Microsoft Internet Explorer') {
				document.getElementById('pldir-'+i+'').style.filter = 'alpha(opacity=50)';
			}
			else {
				document.getElementById('pldir-'+i+'').style.opacity = '0.5';
			}
		}
		largePhotoCycle(); // Activates the cycle...
	}
}



var thisPhoto = 1; // Currently viewed photo...
var previousPhoto = photoTotal; // This is a dummy value...

// The large photo descriptions...
var photoDescription = new Array();
	photoDescription[0] = "This is the photo's description (1)";
	photoDescription[1] = "This is the photo's description (2)";
	photoDescription[2] = "This is the photo's description (3)";
	photoDescription[3] = "This is the photo's description (4)";
	photoDescription[4] = "This is the photo's description (5)";
	photoDescription[5] = "This is the photo's description (6)";
	photoDescription[6] = "This is the photo's description (7)";
	photoDescription[7] = "This is the photo's description (8)";
	photoDescription[8] = "This is the photo's description (9)";

function largePhotoCycle() {

	if (thisPhoto <= photoTotal) {

		// Firstly, reset the border and transparency of the previous directory photo...

		document.getElementById('pldir-'+previousPhoto+'').style.border = '3px solid #FFF';

		if (navigator.appName == 'Microsoft Internet Explorer') {
			document.getElementById('pldir-'+previousPhoto+'').style.filter = 'alpha(opacity=50)';
		}
		else {
			document.getElementById('pldir-'+previousPhoto+'').style.opacity = '0.5';
		}

		// Then show the next large photo and description in the cycle...

		document.getElementById('photo').src = 'images/photo-library/'+thisPhoto+'.gif';
		document.getElementById('description').innerHTML = photoDescription[thisPhoto - 1];

		// Whilst also changing the border and transparency of the next photo in the directory...

		document.getElementById('pldir-'+thisPhoto+'').style.border = '3px solid #CFD1ED';

		if (navigator.appName == 'Microsoft Internet Explorer') {
			document.getElementById('pldir-'+thisPhoto+'').style.filter = 'alpha(opacity=100)';
		}
		else {
			document.getElementById('pldir-'+thisPhoto+'').style.opacity = '100';
		}

		// Finally, previousPhoto records the current thisPhoto value before incrementing thisPhoto...

		previousPhoto = thisPhoto;
		thisPhoto = thisPhoto + 1;
	}
	else {

		// Resets the loop...

		previousPhoto = thisPhoto - 1;
		thisPhoto = 1;
	}

	// Restarts the loop...

	setTimeout('largePhotoCycle()', 10000);
}



function showPhoto(whichPhoto) {

	// Firstly, reset the border and transparency of the currently cycled directory photo...

	for (i=1; i<=photoTotal; i++) {
		document.getElementById('pldir-'+i+'').style.border = '3px solid #FFF';

		if (navigator.appName == 'Microsoft Internet Explorer') {
			document.getElementById('pldir-'+i+'').style.filter = 'alpha(opacity=50)';
		}
		else {
			document.getElementById('pldir-'+i+'').style.opacity = '0.5';
		}
	}

	// Then show the selected large photo and description...

	document.getElementById('photo').src = 'images/photo-library/'+whichPhoto+'.gif';
	document.getElementById('description').innerHTML = photoDescription[whichPhoto - 1];

	// Whilst also changing the border and transparency of the selected directory photo...

	document.getElementById('pldir-'+whichPhoto+'').style.border = '3px solid #CFD1ED';

	if (navigator.appName == 'Microsoft Internet Explorer') {
		document.getElementById('pldir-'+whichPhoto+'').style.filter = 'alpha(opacity=100)';
	}
	else {
		document.getElementById('pldir-'+whichPhoto+'').style.opacity = '100';
	}

	// Visually resets the loop...

	previousPhoto = whichPhoto;
	thisPhoto = whichPhoto + 1;
}

//###

