//SITE MAP INFO LAYER FUNCTIONS
var infoSrcLoaded=false;

//BROWSER DETECTION
 var IE;
 var NS;
 var version;

 if(navigator.appName.indexOf('Netscape') == -1) {
         IE=true;
 } else {
         NS=true;
 }

 version = parseFloat(navigator.appVersion);

// FADE IN CONTROL

function high(){
highlighting=setInterval("highlightit()",20);
}

function low(){
	clearInterval(highlighting);
infoBox.filters.alpha.opacity=0;
}

function highlightit(){
if (infoBox.filters.alpha.opacity<100)
infoBox.filters.alpha.opacity+=20
else if (window.highlighting)
clearInterval(highlighting)
}


// MOUSE FOLLOW CONTROL

function followmouse1(){
//move cross engine for IE 4+
infoBox.style.pixelTop=event.clientY+10;
infoBox.style.pixelLeft=event.clientX+10;
}

function followmouse2(e){
//move cross engine for NS 4+
document.leftright.top=e.y+1
document.topdown.top=pageYOffset
document.topdown.left=e.x+1
}

if (document.all)
document.onmousemove=followmouse1
else if (document.layers){
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=followmouse2
}

// WRITE IN REQUIRED OBJECTS

// STYLE SHEETS
document.write('<link rel="stylesheet" href="scripts/main_Box_IE.css" type="text/css">');

// INFO DIV
document.write('<div id="infoBox" class="rentBox" style="visibility: hidden; width: 160;">');
document.write('  <table width="100%" border="0" cellspacing="0" cellpadding="3" height="100%" class="infoBoxTable">');
document.write('    <tr>');
document.write('      <td align="left" valign="top">');
document.write('        <div id="infoText" class="rentText"></div>');
document.write('      </td>');
document.write('    </tr>');
document.write('  </table>');
document.write('</div>');

// EMBED SOUNDS
document.write("<EMBED NAME='CS987021908970' SRC='sounds/openInfo.wav' LOOP=false AUTOSTART=false MASTERSOUND HIDDEN=true WIDTH=0 HEIGHT=0>");

// POP INFO LINK
var webRoot = "http://www.r-house.co.uk/";
var FolderArray=new Array('r_info/info_frame.html','r_landlord/landlord_frame.html','r_student/stu_frame.html','r_tolet/tolet_frame.html');

function popinfoLink(varName,varInfo){

	if(!varInfo){
			document.all.infoBox.style.visibility='hidden';
			if(IE){
					low();
			}
	}
	
	var FileLocation=varName[0];
	var FileType=varName[1];
	var theLink = webRoot+FolderArray[FileType]+"?"+FileLocation;
	checkWin(theLink,550,450,null,null);
}

// INFO LAYER CONTROL

var classArray=new Array('rhouseBox','landlordBox','studentBox','toletBox');

function itemInfo(showItemInfo){
	if(infoSrcLoaded){
		if(showItemInfo){
		//	MM_controlSound('play','document.CS987021908970','sounds/openInfo.wav');
			document.all.infoBox.className=classArray[showItemInfo[1]];
			document.all.infoText.innerHTML=showItemInfo[2];
			document.all.infoBox.style.visibility='visible';
			if(IE){
				high();
			}
		}else{
			document.all.infoBox.style.visibility='hidden';
			if(IE){
				low();
			}
		}
	}
}


// SOUND CONTROL -- Macromedia Dreamweaver -- Thanks :-)

function MM_controlSound(x, _sndObj, sndFile) { //v3.0
  var i, method = "", sndObj = eval(_sndObj);
  if (sndObj != null) {
    if (navigator.appName == 'Netscape') method = "play";
    else {
      if (window.MM_WMP == null) {
        window.MM_WMP = false;
        for(i in sndObj) if (i == "ActiveMovie") {
          window.MM_WMP = true; break;
      } }
      if (window.MM_WMP) method = "play";
      else if (sndObj.FileName) method = "run";
  } }
  if (method) eval(_sndObj+"."+method+"()");
  else window.location = sndFile;
}


function swapColor(newColor){
	changer.style.backgroundColor=newColor;
}

// source now fully loaded 
infoSrcLoaded=true;


