var addtolist_0 = "property NOT added";
var addtolist_1 = "<img src='../images/btn_property_added.gif'/>";
var addtolist_2 = "property already added";

var removetolist_0 = "property NOT removed";
var removetolist_1 = "property removed";

function useplace (place)
{
	document.forms.rss.place.value=place;
	document.getElementById("pricerange").style.display="block";
	document.getElementById("chosenplace").innerHTML=place;

}

function useprices (from,to,type)
{
	window.open ("../rss/index.php?type="+type+"&minprice="+from+"&maxprice="+to+"&place=" + document.forms.rss.place.value);
}

function _setMapSize() {}
function _initExtra() {
zoom.hide();
}

function _registerEvents() {}

function _doDefaults(){}

function $(elid){
	i= document.getElementById(elid);
	return i;
}

function _populateBubbleInner (pin)
{
        mapmanager.requestmanager.div = "bubblediv";
        mapmanager.requestmanager.lat = pin.lat;
        mapmanager.requestmanager.lng = pin.lng;
        mapmanager.requestmanager.doRequest ("handleHTMLRequest","http://mellor.waidev6.com/staging/panes/pane_property.php?type="+settings.type+"&id="+pin.id+"&config="+settings.configuration+"&bubble="+mapmanager.bubbleStyle+"&lat="+pin.lat+"&lng="+pin.lng)
}
function tnav(el,sr)
{
	if (sr.match('_off.gif'))
	{
		el.src=sr.replace("_off.gif","_on.gif");
	}else{
		el.src=sr.replace("_on.gif","_off.gif");
	}
}

function showDiv(div){
        $(div).style.display="block";
}
function hideDiv(div){
        $(div).style.display='none';
}


function tmo(img,marker)
{
	el=$(img);
	sr=el.src;
	tnav(el,sr);

	el=$(marker);
	sr=el.src;
	tnav(el,sr);
}
function mo(a)
{
	el=$($(a.id).firstChild.id);
	sr=el.src;
	tnav(el,sr);
}

var navStop="";
function navPointer(el){
	if(el!= navStop){
	cl=$(el).className;
	if(cl.indexOf("t_nav_elem_off")>=0){
		$(el).className="t_nav_elem_on";
	}else{
		$(el).className="t_nav_elem_off";
	}
}
}
function removePointer(){
	var elements = (document.all)? document.all : document.getElementsByTagName('div');
	var current;
	var length = elements.length;
	for(var i=0; i<length; i++){
		current = elements[i];
		if(current.className.indexOf("t_nav_elem_on")>=0){
			current.className="t_nav_elem_off";
		}
	}
}

function navSelector(el){
	removePointer();
	$(el).className="t_nav_elem_on";
	navStop=el;
}
var subInView="";
if(navigator.userAgent.indexOf("MSIE")>0){
var block=20;
}else{
var block=10;
}
function showSub(sub){
	if(subInView !=sub){
		if(subInView != ""){
			h=$(subInView).offsetHeight;
			tween1=new Tween($(subInView).style,'height',Tween.regularEaseOut,h,2,0.4,'px');
		}
		h=block*($(sub).childNodes.length);
		$(sub).style.display='block';
		tween2=new Tween($(sub).style,'height',Tween.regularEaseIn,2,h,0.4,'px');
		if(subInView != ""){
			tween2.start();
			tween2.onMotionFinished=tween1.start();
		}else{
			tween2.start();
		}
		subInView=sub;
	}
}

function removeSavedProperty(p,s,t,e){
	removeproperty(p,s,t,e);
	$("property_"+p).style.display='none';

 }
// returns true if oNode is contained by oCont (container)
function contained(oNode, oCont) {
  if (!oNode) return; // in case alt-tab away while hovering (prevent error)
  while ( oNode = oNode.parentNode ) if ( oNode == oCont ) return true;
  return false;
}
function menuB2()
{
	$('menuB2').style.display='block';
	$('menu1').style.display='none';
}
function menuB1()
{
	$('menuB2').style.display='none';
	$('menu1').style.display='block';
}


function navResize(){
        if($('t-content')){
                if($('t-content').offsetHeight>$('t-nav').offsetHeight){
                        $("t-nav").style.height=$("t-content").offsetHeight;
                }
        }else{
		if($('t-content-flush')){
			  if($('t-content-flush').offsetHeight>$('t-nav').offsetHeight){
                        	$("t-nav").style.height=$("t-content-flush").offsetHeight;
               		 }
		}else{
                	if($('th-content').offsetHeight>$('t-nav').offsetHeight){
                	       	 $("t-nav").style.height=($("th-content").offsetHeight);
                	}
       		 }
	}
}
function loginlist(el){
        $('registerorlogin').style.top=$(el).offsetTop + 'px';
        $('registerorlogin').style.left=($(el).offsetLeft + 300)+ 'px';
        $('registerorlogin').style.display='block';
}


//----------------------------------------------------------------------------------------------------------------------------------------------------------



//Property Details Slideshow functions -------------------------------------------------------------------------------------------------
var divId=0;
//var nDiv;tDiv;item;nItem;tDiv;nDiv;
var interval=2;
interval=interval*1000;
var l,el,el2,rot,rotevt,c;
var pause=0;

var inview="";
var inThumb='';

function clSwap(el,on){
	if(($(el).className.match("_off")) && (on="on")){
		$(el).className=$(el).className.replace("_off","_on");
	}else{
		$(el).className=$(el).className.replace("_on","_off");
	}
	if((inThumb!="")&&(inThumb!=el)){
		if($(inThumb).className.match("_on")){
			$(inThumb).className=$(inThumb).className.replace("_on","_off");
		}
	}
	inThumb=el;
}

function rotateDiv(n,evt){
	el2="slide_"+n;
	$(el2).style.zIndex='9';
	if((inView!="")&&(inView!=el2)){
		el="slide_"+inView;
		$(el).style.zIndex='10';
		opacityTween= new OpacityTween($(el),Tween.regularEaseOut, 100, 0, 1);
		opacityTween.start();
		clSwap(("thumb_"+inView),"off");
	}
	opacityTween2= new OpacityTween($(el2),Tween.regularEaseIn, 0,100, 1);
	opacityTween2.start();	
	clSwap(("thumb_"+n),"on");
	inView=n;
	for(i=0;i<=divElement.length;i++){
		if(divElement[i]==n){
			c=i;
		}
	}
	if(divElement[(divElement.length-1)]<(c+1)){
		nxt=divElement[0];
	}else{
		nxt=divElement[c+1];
	}
}

function initSlideShow(){
	for(i=(divElement.length-1);i>=0;i--)
	{	
		opacityTween= new OpacityTween(document.getElementById("slide_"+divElement[i]),Tween.regularEaseOut, 10, 0, 0.002);
		opacityTween.start();
		document.getElementById("slide_"+divElement[i]).style.display='block';
	}
	rot=setTimeout("rotateDiv(1,false)",1000);
}
function menuPrev(){
	current = $('currentMenu').value;
	prev = parseInt(current)-1;
	if ($('menu'+prev)) {
		$('menu'+current).style.display='none';
		$('menu'+prev).style.display='block';
		$('currentMenu').value = prev;
	}
}
function menuNext(){
	current = $('currentMenu').value;
	next = parseInt(current)+1;
	if ($('menu'+next)) {
		$('menu'+current).style.display='none';
		$('menu'+next).style.display='block';
		$('currentMenu').value = next;
	}
}
		
//----------------------------------------------------------------------------------------------------------------------------------------------------------