var str_thumbnails = "";
var arr_photos = new Array();

function roNav(str_state, str_element){
	if(str_element=="01"){
		if(str_state=="over"){
			document.images['img_nav01'].src='http://www.ballintyre.ie/images/nav_homepageR.gif';
		}
		else if(str_state=="out"){
			document.images['img_nav01'].src='http://www.ballintyre.ie/images/nav_homepage.gif';
		}
	}
	if(str_element=="02"){
		if(str_state=="over"){
			document.images['img_nav02'].src='http://www.ballintyre.ie/images/nav_locandamenitiesR.gif';
		}
		else if(str_state=="out"){
			document.images['img_nav02'].src='http://www.ballintyre.ie/images/nav_locandamenities.gif';
		}
	}
	if(str_element=="03"){
		if(str_state=="over"){
			document.images['img_nav03'].src='http://www.ballintyre.ie/images/nav_siteplanR.gif';
		}
		else if(str_state=="out"){
			document.images['img_nav03'].src='http://www.ballintyre.ie/images/nav_siteplan.gif';
		}
	}
	if(str_element=="04"){
		if(str_state=="over"){
			document.images['img_nav04'].src='http://www.ballintyre.ie/images/nav_propertiesR.gif';
		}
		else if(str_state=="out"){
			document.images['img_nav04'].src='http://www.ballintyre.ie/images/nav_properties.gif';
		}
	}
	if(str_element=="05"){
		if(str_state=="over"){
			document.images['img_nav05'].src='http://www.ballintyre.ie/images/nav_brochureR.gif';
			
		}
		else if(str_state=="out"){
			document.images['img_nav05'].src='http://www.ballintyre.ie/images/nav_brochure.gif';
		}
	}
	if(str_element=="06"){
		if(str_state=="over"){
			document.images['img_nav06'].src='http://www.ballintyre.ie/images/nav_newHomeR.gif';
		}
		else if(str_state=="out"){
			document.images['img_nav06'].src='http://www.ballintyre.ie/images/nav_newHome.gif';
		}
	}		
	if(str_element=="07"){
		if(str_state=="over"){
			document.images['img_nav07'].src='http://www.ballintyre.ie/images/nav_videoR.gif';
		}
		else if(str_state=="out"){
			document.images['img_nav07'].src='http://www.ballintyre.ie/images/nav_video.gif';
		}
	}		
	if(str_element=="08"){
		if(str_state=="over"){
			document.images['img_nav08'].src='http://www.ballintyre.ie/images/nav_homechoiceR.gif';
		}
		else if(str_state=="out"){
			document.images['img_nav08'].src='http://www.ballintyre.ie/images/nav_homechoice.gif';
		}
	}				
}

function swapImage(num_image){
	document.images['img_largeImage'].src="../../images/photos/" + arr_photos[num_image] + ".jpg";
	//document.getElementById('divPropertiesContent').style.height= parseInt( document.images['img_largeImage'].height )+33 + "px";
}

function initPhotos(){

	var num_photos = arr_photos.length;
	
	for(var x=0; x<num_photos+1; x++){
		str_thumbnails = str_thumbnails + "<div id='divThumbnail" + (x+1) + "'><img src='../../images/photos/" + arr_photos[x] + "_TN.jpg' border='0' alt='' onClick='swapImage(" + x + ")'></div>";
	}
	str_thumbnails = str_thumbnails + "<img src='../../images/spacer.gif' height='45' width='1' /><div id='divLargeImage'><img name='img_largeImage' src='../../images/photos/" + arr_photos[0] + ".jpg' border='0' alt='' /></div>";
	
}

function floorplanPopup(str_image,intLegend)
{
var str_filename = "floorplan.asp?img=" + str_image + "&legend=" + intLegend;
window.open(str_filename,"floorplan","status=no,scrollbars=1,width=800,height=600");
}

function checkEmailFormat(strEntered) {
	if ((strEntered.indexOf("@")< 1) || (strEntered.indexOf(".") == -1)) {
		alert("Please enter a valid email address.");
	}
}


function checkForChar(passedForm)
{
	if ((passedForm.name.value == "") || (passedForm.email.value == "")) {
		alert("Please provide at least your name and an email address.");
		return false;
	}
	else
	{
		if ((passedForm.name.value.indexOf("@") < 0) && (passedForm.address.value.indexOf("@") < 0) && (passedForm.telephone.value.indexOf("@") < 0) && (passedForm.propertyType.value.indexOf("@") < 0 )&& (passedForm.query.value.indexOf("@") < 0)){
			return true;
		}
		else {
			alert("Please enter only letters, numbers and punctuation \nin fields other than your email address.");
			return false;
		}
	}
}

