// JavaScript Document
function externalLinks() {  
	if (!document.getElementsByTagName) return;  
	var anchors = document.getElementsByTagName("a");  
	for (var i=0; i<anchors.length; i++) {  
		var anchor = anchors[i];  
			if (anchor.getAttribute("href") &&  anchor.getAttribute("rel") == "external")  anchor.target = "_blank";  
		}  
}
window.onload = externalLinks; 

function movieIsLoaded(movieName) {
  // First make sure the movie's defined.
  if (typeof(movieName) != "undefined") {
    // If it is, check how much of it is loaded.
    return movieName.PercentLoaded() == 100;
  } else {
    // If the movie isn't defined, it's not loaded.
    return false;
  }
}		
function changeImg(img){
	//if(movieIsLoaded(thisMovie("mapPhotoContainer"))) {
		thisMovie("mapContainer").changeImg(img);
	//}
}
function curDots(num){
	//if(movieIsLoaded(thisMovie("mapPhotoContainer"))) {
		thisMovie("mapContainer").curDots(num);
	//}
}
function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}
function changeColor(id) {
	var defaultCSS = ['a:link { color:#627d79; text-decoration:none; }', 'a:hover { color:#522d24; text-decoration:underline; }'];
	for (var i = 0; i < sIFR.replacements['h6'].length; i++) {
		 sIFR.replacements['h6'][i].changeCSS(defaultCSS);
	}
  var css = ['a:link { color:#522d24; text-decoration:underline; }', 'a:hover { color:#627d79; }'];
    sIFR.replacements['h6'][id].changeCSS(css);
}

function curMapCategory(num){
	//document.getElementById('mapListings').innerHTML = 
	for (var i = 0; i < 4; i++) {
		document.getElementById('cat'+i).style.display='none';	
	}
	document.getElementById('cat'+num).style.display='block';	
}
function curFPLink(num, num2) {
	for(var i=1; i<=6; i++){
		document.getElementById('fpLink'+i).style.color='#542d24';
		document.getElementById('fpArrow'+i).style.visibility='hidden';
		if(i == '2' || i == '3' || i == '4' || i == '6' || i == '5'){
			document.getElementById('fp'+i+'Ul').style.display='none';
			document.getElementById('fp'+i+'opt1').style.color='#542d24';
			document.getElementById('fp'+i+'opt2').style.color='#542d24';
			/*if(document.getElementById('fp'+i+'opt3') !== null){
				document.getElementById('fp'+i+'opt3').style.color='#542d24';
			}*/
		}
	}
	document.getElementById('fpLink'+num).style.color='#627d79';
	document.getElementById('fpArrow'+num).style.visibility='visible';
	
	if(num == '2' || num == '3' || num == '4' || num == '6' || num == '5'){
		document.getElementById('fp'+num+'Ul').style.display='block';
		document.getElementById('fp'+num+'opt'+num2).style.color='#627d79';
		document.getElementById('backToHomes').style.marginTop = '10px';
	}
	else {
		document.getElementById('backToHomes').style.marginTop = '22px';
	}
}
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
