/* Rollovers */
function s_on(imgname, ext) {
	document[imgname].src = "../images/"+imgname+"_on."+ext;
}

function s_off(imgname, ext) {
	document[imgname].src = "../images/"+imgname+"_off."+ext;
}

/* Listing Photos */
function on_photo(photo) {
	if(document.all) {
		mainphoto.style.filter="blendTrans(duration=0.5)";
		mainphoto.filters.blendTrans.Apply();
	}
	document.mainphoto.src = eval(photo).src;
	
	if(document.all) {
		mainphoto.filters.blendTrans.Play();
	}
}

function on_caption(str){
	if(!document.getElementById) return; // Not Supported
	if(document.getElementById){
		document.getElementById("caption").innerHTML = str;
	}
}

/* Our Photos Verification */
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

/* Popups */
function popup_map(URL){
	mywindow = window.open(URL,"","width=600,height=700,scrollbars=yes,resizable=no,toolbar=no,menubar=no,status=no,location=no,directories=no");
}
function popup_photos(id){
	mywindow = window.open("../_tools/popup_photos.php?id=" +id,"","width=450,height=600,scrollbars=yes,resizable=no,toolbar=no,menubar=no,status=no,location=no,directories=no");
}
function popup_inquiry(id,emailaddress){
	mywindow = window.open("../_tools/popup_inquiry.php?id=" +id +"&emailaddress=" +emailaddress,"","width=450,height=500,scrollbars=yes,resizable=no,toolbar=no,menubar=no,status=no,location=no,directories=no");
}