/* <![CDATA[ */
if(!window.addNamespace){
	window.addNamespace=function(ns){
		var nsParts=ns.split('.'),root=window;for(var i=0,l=nsParts.length;i<l;++i){if(typeof root[nsParts[i]]==='undefined'){root[nsParts[i]]={};}root=root[nsParts[i]];}
	};
}
if(!window.Class){var Class={create:function(){return function(){if(typeof this.initialize==='function'){this.initialize.apply(this,arguments);}};}};}

// suppress errors in NN4.x (like try ... catch blocks)
if(!document.getElementById&&document.layers){window.onerror=function(){if(window.__onerror){window.__onerror();}return true;};}
if(!Object.extend){
	Object.extend=function extend(dest,source,override){for(prop in source){if(override||typeof dest[prop]==='undefined'){dest[prop]=source[prop];}}return dest;};
}
if(!Object.hasOwnProperty){
	Object.hasOwnProperty=function hasOwnProperty(property){
		try{var prototype=this.constructor.prototype;while(prototype){if(prototype[property]===this[property]){return false;}prototype=prototype.prototype;}}catch(e){}
		return true;
	};
}/* prototypes and helper object initialisation */
(function(){
	if(![].push){Array.prototype.push=function(){for(var i=0;i<arguments.length;++i){this[this.length]=arguments[i];}return this.length;};}
	if(![].pop){Array.prototype.pop=function(){var r=null;if(this.length){r=this[this.length-1];--this.length;}return r;};}
	if(![].copy){Array.prototype.copy=function(){var a=[];for(var i=0;i<this.length;++i){a[i]=this[i].copy?this[i].copy():this[i];}return a;};}
	if(![].concat){Array.prototype.concat=function(a){var b=this.copy();for(var i=0;i<a.length;++i){b.push(a[i]);}return b;};}
	if(![].reverse){Array.prototype.reverse=function(){var a=[],i=this.length;while(i>0){a.push(this[--i]);}return a;};}
	if(![].shift){Array.prototype.shift=function(){var r=null;if(this.length){r=this.reverse().pop();this.reverse();}return r;};}
	if(![].unshift){Array.prototype.unshift=function(){this.reverse();for(var i=0;i<arguments.length;++i){this.push(arguments[i]);}this.reverse();return this.length;};}
	if(![].splice){Array.prototype.splice=function(b,d){var m=b+d,af=this.slice(m),r=d>0?this.slice(b,m-1):[];for(var i=2;i<arguments.length;++i){af.unshift(arguments[i]);}if(b>0){this.slice(0,b).concat(af);}else{while(this.length){this.pop();}while(af.length){this.push(af.pop());}}return r;};}
Object.extend(String.prototype,{
	endsWith:function(s){return (this.substr(this.length-s.length)===s);},
	entityify:function(){return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');},
	lTrim:function(){return this.replace(/^\s+/,'');},
	quote:function(){
		var c,i,l=this.length,o='"';
		for(i=0;i<l;i+=1){
			c=this.charAt(i);if(c>=' '){if(c==='\\'||c==='"'){o+='\\';}o+=c;}
			else{
				switch(c){
					case '\b':o+='\\b';break;case '\f':o+='\\f';break;case '\n':o+='\\n';break;case '\r':o+='\\r';break;case '\t':o+='\\t';break;
					default:c=c.charCodeAt();o+='\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);
				}
			}
		}
		return o+'"';
	},
	rTrim:function(){return this.replace(/\s+$/,'');},
	startsWith:function(s){return (this.substring(0,s.length)===s);},
	supplant:function(o){
		var i,j,s=this,v;
		for(;;){
			i=s.lastIndexOf('{');if(i===-1){break;}j=s.indexOf('}',i);if(i+1>=j){break;}
			v=o[s.substring(i+1,j)];if((typeof v!=='string')&&((typeof v!=='number')||!isFinite(v))){break;}
			s=s.substring(0,i)+v+s.substring(j+1);
		}
		return s;
	},
	toCamelCase:function(b){var s='',w,wA=this.split(' ');if(wA.length==1)wA=this.split('-');for(var i=b?0:1;i<wA.length,w=wA[i++];){s+=w.charAt(0).toUpperCase()+w.substring(1);}return b?s:wA[0]+s;},
	toPattern:function(){var rS='/*?.+,~@|;^$[]{}()',r=this,s;for(var i=0;i<rS.length,s=rS.charAt(i++);){r=r.replace(eval('/\\'+s+'/g'),'\\'+s);}return r;},
	toProperCase:function(){var s='',w,wA=this.split(' ');for(var i=0;i<wA.length,w=wA[i++];){s+=w.charAt(0).toUpperCase()+w.substring(1);}return s;},
	toSelectCase:function(){var s='',c;for(var i=0;i<this.length,c=this.charAt(i).toLowerCase();){s+=this.charAt(i++)==c.toUpperCase()?'-'+c:c;}return s;},
	trim:function(){return this.lTrim().rTrim();}
});
})();

var __Browser=function(){
	var self=this;this.__parseInt=function(x,r){return isNaN(r=parseInt(x,10))?0:r;};this.__db=(document.compatMode&&document.compatMode.toLowerCase()!='backcompat'||document.documentElement)?document.documentElement:(document.body||null);this.__n6=!!((typeof window.getComputedStyle!=='undefined')&&(typeof document.createRange!=='undefined'));
	this.Opera=!!(window.opera);this.OperaVer=this.Opera?!!(window.getSelection)?9:!!(opera.defineMagicFunction)?8:!!(opera.version)?7.6:!!(document.createComment)?7:!!(opera.buildNumber)?6:5:0;
	this.IE=!!(document.all&&!self.Opera&&self.__db&&(/microsoft/i.test(navigator.appName)));this.IEVer=self.IE?(/mac/i.test(navigator.platform))?5.2:!!(document.createComment)?6:!!(document.fireEvent)?5.5:!!(document.getElementById)?5:4:0;this.IEMac=!!(self.IE&&(self.IEVer===5.2));
	this.w3c=!!(!self.Opera&&!self.IE&&!self.__n6&&document.getElementById);this.NN4=!!(!self.w3c&&document.layers&&(typeof document.classes!=='undefined'));this.Safari=!!(!document.all&&document.childNodes&&!navigator.taintEnabled);this.px=self.NN4?'':'px';this.tiv=self.w3c?40:10;
	this.window={
		height:self.__parseInt((self.__db&&!self.Opera&!self.w3c&&self.__db.clientHeight)?self.__db.clientHeight:(window.innerHeight||0)),
		scroll:{x:self.__parseInt(window.pageXOffset||(self.__db?self.__db.scrollLeft:0)),y:self.__parseInt(window.pageYOffset||(self.__db?self.__db.scrollTop:0))},
		width:self.__parseInt((self.__db&&!self.Opera&&!self.w3c&&self.__db.clientWidth)?self.__db.clientWidth:(window.innerWidth||0))
	};
};
__Browser.prototype.getComputedStyle=function(el,prop){
	if(document.defaultView&&document.defaultView.getComputedStyle){return document.defaultView.getComputedStyle(el,'').getPropertyValue(prop);}
	if(el.currentStyle){var m=prop.match(/-[a-z]/g),mI;if(m){while((mI=m.pop())){prop=prop.replace(mI,mI.substr(1).toUpperCase());}}return el.currentStyle[prop];}
	if(el.style[prop]){return el.style[prop];}
	return null;
};
var Browser=new __Browser(),Events;
(function(){
	// mozilla equivalent for insertAdjacentElement and inner|outer HTML|Text in IE5+
	// workaround for Opera 8 (which doesn't handle __define[G|S]etter__)
	if(typeof HTMLElement!=='undefined'){
		if(!HTMLElement.prototype.outerHTML){
			if(window.opera){HTMLElement.prototype.outerHTML=function(s){return s?(document.documentElement.outerHTML=s):document.documentElement.outerHTML;};}
			else{HTMLElement.prototype.__defineSetter__('outerHTML',function(s){var r=this.ownerDocument.createRange();r.setStartBefore(this);var df=r.createContextualFragment(s);this.parentNode.replaceChild(df,this);return this;});HTMLElement.prototype.__defineGetter__('outerHTML',function(){var aA=this.attributes,eT=['area','base','basefont','br','col','frame','hr','img','input','isindex','link','meta','param'],cA=['checked','compact','declare','defer','disabled','ismap','multiple','nohref','noresize','noshade','nowrap','readonly','selected'],t=this.tagName.toLowerCase(),s='<'+t;for(var i=0,a=aA[i].name.toLowerCase(),p=cA.within(a,true),v=aA[i].value,l=aA.length;i<l;++i){s+=' '+a+'="'+((p>-1&&!v.length)?cA[p]:v)+'"';}s+=(eT.within(t))?' />':'>'+this.innerHTML+'</'+t+'>';return s;});}
		}
		if(!HTMLElement.prototype.innerText){
			if(window.opera){HTMLElement.prototype.innerText=function(s){return s?(document.documentElement.innerText=s):document.documentElement.innerText;};}
			else{HTMLElement.prototype.__defineSetter__('innerText',function(s){this.innerHTML=s.escapeHTML();return this;});HTMLElement.prototype.__defineGetter__('innerText',function(){var r=this.ownerDocument.createRange();r.selectNodeContents(this);return String(r);});}
		}
		if(!HTMLElement.prototype.outerText){
			if(window.opera){HTMLElement.prototype.outerText=function(s){return s?(document.documentElement.outerText=s):document.documentElement.outerText;};}
			else{HTMLElement.prototype.__defineSetter__('outerText',function(s){this.outerHTML=s.escapeHTML();return this;});HTMLElement.prototype.__defineGetter__('outerText',function(){return this.innerText();});}
		}
		if(!HTMLElement.prototype.insertAdjacentElement){
			HTMLElement.prototype.insertAdjacentElement=function(w,pN){switch(String(w).toLowerCase()){case 'afterbegin':this.insertBefore(pN,this.firstChild);break;case 'afterend':if(this.nextSibling){this.parentNode.insertBefore(pN,this.nextSibling);}else{this.parentNode.appendChild(pN);}break;case 'beforebegin':this.parentNode.insertBefore(pN,this);break;case 'beforeend':this.appendChild(pN);break;}return this;};
			HTMLElement.prototype.insertAdjacentHTML=function(w,S){var r=this.ownerDocument.createRange();switch(String(w).toLowerCase()){case 'beforebegin':r.setStartBefore(this);break;case 'beforeend':case 'afterbegin':r.selectNodeContents(this);r.collapse(false);break;case 'afterend':r.setStartAfter(this);break;}var pH=r.createContextualFragment(S);this.insertAdjacentElement(w,pH);return this;};
			HTMLElement.prototype.insertAdjacentText=function(w,s){this.insertAdjacentHTML(w,s.escapeHTML());return this;};
		}
	}
	Events=Events||{
		aeOL:[],
		Cancel:function(e,c){e.returnValue=false;if(e.preventDefault){e.preventDefault();}if(c){e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}}return this;},
		ieMouse:function(n){return (/^mouseo(ut|ver)$/.test(n)&&window.attachEvent)?(/ver$/.test(n))?'mouseenter':'mouseleave':n;},
		operaObj:function(o,b){var d=(b?'add':'remove')+'EventListener';return (o===window&&!o[d]&&document[d])?document:o;}
	};
	Events.Add=document.addEventListener?(
		function(o,n,f,l){o=Events.operaObj(o,true);if(!l||(l&&typeof l!=='boolean')){l=new Boolean(false);}return o.addEventListener(n,f,l);}):(
		function(o,n,f,l){
			n=Events.ieMouse(n);var c='captureEvents',h='on'+n,t,a;if(!o.aE){o.aE=Events.aeOL.length||1;Events.aeOL[o.aE]={o:o};}t=Events.aeOL[o.aE][n]||(Events.aeOL[o.aE][n]=[]);
			for(var i=0;i<t.length;i++){for(var j=0;j<t[i].length;j++){if(t[i][j]==f){return true;}}}if(o[h]&&o[h]._ae){a=t[t.length-1];a[a.length]=f;}
			else{t[t.length]=o[h]?[o[h],f]:[f];o[h]=new Function('e','var r=true,i=0,o=Events.aeOL['+o.aE+'].o,a=Events.aeOL['+o.aE+'][\''+n+'\']['+(t.length-1)+'];for(;i<a.length;i++){o._f=a[i];r=o._f(e||window.event)!=false&&r;o._f=null;}return r;');if(o[c]){o[c](Event[n.toUpperCase()]);}o[h]._ae=1;}
			return true;}
	);
	Events.Remove=document.removeEventListener?(
		function(o,n,f,l){o=Events.operaObj(o);if(!l||(l&&typeof l!=='boolean')){l=new Boolean(false);}return o.removeEventListener(n,f,l);}):(
		function(o,n,f,l){n=Events.ieMouse();var c='releaseEvents',t,a,i,j,s;if(!o.aE||!Events.aeOL[o.aE]||!Events.aeOL[o.aE][n]){return true;}t=Events.aeOL[o.aE][n];i=t.length;while(i--){a=t[i];s=0;j=a.length;while(j--){if(a[j]==f){s=1;}if(s){a[j]=a[j+1];}}if(s){a.length--;break;}}if(!i){Events.aeOL[o.aE][n]=o.aE=o[h]=null;if(o[c]){o[c](Event[n.toUpperCase()]);}}return true;}
	);
})();

/* Run on DOM loaded code */
/* this is the function that will run */
function domInit(){
	if(arguments.callee.done){return;}arguments.callee.done=true; //double execution check
	if(Browser.IEMac||Browser.NN4){return;} // we don't run script on IE5.2/Mac or NN4...
	loadedInit();
/* do not change above this line */
}
/* conditional IE/Win code */
/*@cc_on @*/
/*@if (@_win32)
	document.write('<script defer src="/includes/genFuncs_ie.js" type="text/javascript"><\/script>');
/*@end @*/
/* End IE/Win conditional code */
/* support other browsers */
if(window.addEventListener&&!window.opera&&!Browser.Safari){window.addEventListener('DOMContentLoaded',domInit,null);} // Mozilla only...
else{Events.Add(window,'load',domInit);}
function loadedInit(){
	if(window.startMarquee){window.startMarquee();}
	fixKeypress();
	fixRel();
}
/* end DOM loaded code */

/* User functions */
var Marquee=function(container,step,tick){
	this.container=container||'';this.step=step?parseInt(step,10):-1;this.tick=tick?parseInt(tick,10):100;
	this.autopause=true;this.bgcolor='#FFF';this.direction='rtl';this.height='1em';this.post='&nbsp;.:';this.pre=':.&nbsp;';this.separator='&nbsp;.:.&nbsp;';this.width=0;
	var self=this,content=[],margin=0,marquee='',mwidth,sty,timer=null;
	function move(){var curpos=parseInt(marquee.style[sty],10);if(curpos>(mwidth*-1)){marquee.style[sty]=Math.max(curpos-self.step,(mwidth*-1))+'px';}else{stop(true);reset(true);}return this;};
	function reset(b){if(b){marquee.style[sty]=self.width+(margin*2)+'px';}timer=window.setInterval(function(){move();},self.tick);return this;};
	function setContent(){
		var c=document.getElementById(self.container);if(!c){return false;}
		sty=self.direction==='rtl'?'left':'right';
		if(self.width===0){self.width=parseInt(Browser.getComputedStyle(c,'width'),10);}
		if(self.step===-1){self.step=Math.floor(self.width/100);}
		margin=parseInt(Browser.getComputedStyle(c,'margin-right'),10);
		c.style.height=(parseInt(self.height,10)===self.height)?self.height+'px':self.height;c.style.overflow='hidden';
		if(!self.pre.length){self.pre=self.separator;}if(!self.post.length){self.post=self.pre;}
		var items=c.getElementsByTagName('ul')[0],item,i=-1;while((item=items.getElementsByTagName('li')[++i])){content.push(item.innerHTML);content.push(self.separator);}
		if(content.length){
			content.unshift(self.pre);content[content.length-1]=self.post;
			if(document.createElement&&c.removeChild){c.removeChild(items);var div=document.createElement('div');div.id=marquee;c.appendChild(div);}
			else{var s=c.innerHTML.replace(/[\n\r\t]/g,'');c.innerHTML=s.substr(0,s.toUpperCase().indexOf('<UL>'))+'<div id="'+marquee+'"></div>';}
			(marquee=document.getElementById(marquee)).innerHTML=content.join('');
			mwidth=parseInt(marquee.clientWidth,10);
		}
		return this;
	};
	function stop(b){if(b){if(timer){window.clearInterval(timer);timer=null;}}else{reset();}return this;};
	this.Start=function(){
		if(!self.container.length||!document.getElementById(self.container)){return false;}
		marquee=container+'_div';if(document.getElementById(marquee)){return false;}
		setContent();
		if(self.autopause){Events.Add(marquee,'mouseover',function(){stop(true);});Events.Add(marquee,'mouseout',function(){stop();});}
		reset(true);
		return this;
	};
	return self;
};

function fixKeypress(){for(var i=0;i<document.links.length,l=document.links[i++];){if(l.onkeypress&&l.onkeypress.length){l.onclick=l.onkeypress;}}}
function fixRel(){for(var i=0;i<document.links.length,l=document.links[i++];)if(l.getAttribute('rel')==='external'){l.target='_blank';}}

function submit_f(fmcform){
	var url=fmcform.action,i=-1,input,s;
	while((input=fmcform[++i])){
		if(!/(reset|submit)/i.test(input.type)){
			s=(/select/i.test(input.type))?input[input.selectedIndex].value:(/(check|radio)/i.test(input.type))?input.checked?'on':'':input.value;
			url+=((url.indexOf('?')!=-1)?'&':'?')+(input.name?input.name:input.id)+'='+s;
		}
	}
	MM_openBrWindow(url,'FlatMateSearch','');
	return false;
}

function openWin(url,name,feat){MM_openBrWindow(url,name,feat);}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  var win=window.open(theURL,winName,features);
  return false;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

/* ]]> */
