<!--
var forSalePropPage = new PropertyPage( );
var soldPropPage = new PropertyPage( );
soldPropPage.setStatusID( "sold" );
soldPropPage.setTabID( "sold_tab2_1" );
var currentPropPage = forSalePropPage;

function go( ){}

function PropertyPage( ) {
	this._currrentType = 7;
	this._currrentTab = "tab2_1";
	this._status = "";
    this._agentID = 18;
	this.getTypeID = function( ) {
		return this._currrentType;
	}
	this.setTypeID = function( t ){
		this._currrentType = t;
	}
	this.getTabID = function( ) {
		return this._currrentTab;
	}
	this.setTabID = function( t ){
		this._currrentTab = t;
	}
	this.getStatusID = function( ) {
		return this._status;
	}
	this.setStatusID = function( s ) {
		this._status = s;
	}
	this.getAgentID = function( ) {
		return this._agentID;
	}
	this.setAgentID = function( a ) {
		this._agentID = a;
	}
}

var Transparency = {
        opacityStart:0,
        opacityEnd:0,
        callback:null,
        id:null,
        timeouts:new Array( ),
        animate:function(id, opacStart, opacEnd, millisec, callback) { 
        	// Clear the timeouts
        	this.reset( );
            var speed = Math.round(millisec / 100); 
            var timer = 0; 
            this.opacityStart = opacStart;
            this.opacityEnd = opacEnd;
            this.callback = callback;
            //determine the direction for the blending, if start and end are the same nothing happens 
            if(opacStart > opacEnd) { 
                for(i = opacStart; i >= opacEnd; i--) { 
                    var timeoutID = setTimeout("Transparency.setOpacity(" + i + ",'" + id + "')",(timer * speed)); 
                    this.addTimeout( timeoutID );
                   	timer++; 
                }    
            } else if(opacStart < opacEnd) { 
                for(i = opacStart; i <= opacEnd; i++) { 
                    var timeoutID = setTimeout("Transparency.setOpacity(" + i + ",'" + id + "')",(timer * speed)); 
                    this.addTimeout( timeoutID );
                    timer++; 
                } 
            }   
        }, 
        addTimeout:function( timeoutID ) {
        	    this.timeouts.push( timeoutID );
        },
        clearTimeouts:function( ) {
        	for ( i = 0; i < this.timeouts.length; i++ ) {
        		clearTimeout( this.timeouts[ i ] );
        	}
        	this.timeouts = new Array( );
        },
        setOpacity:function( opacity, id ) {
        	try {
                var object = document.getElementById(id);
                var _opacity = ( opacity / 100 );
                object.style.opacity = _opacity;
                object.style.MozOpacity = _opacity;
                object.style.KhtmlOpacity = _opacity;
                object.style.filter = "alpha(opacity=" + opacity + ")"; 
                if ( this.callback && opacity == this.opacityEnd) {
                    this.callback.complete( id )
                }
            }
            catch( err ) { }
        },
        reset:function( ) {
        	this.clearTimeouts( );
        }
    }

var ContentAjaxObject = {
	_httpRequestObj:null,
	handleSuccess:function(o){
		_httpRequestObj = o;
		this.processResult( );
	},
	handlePropertiesSuccess:function( o ) {
		_httpRequestObj = o;
		this.processPropertiesResult( );
	},
	handleFailure:function(o){
		alert("failed: " + o.responseText);
	},
	processResult:function(){
		writeInnerHtml( "page_content", _httpRequestObj.responseText);
		//fadeIn( .5, "page_content" );
		_httpRequestObj = null;
	},
	processPropertiesResult:function(){
		writeInnerHtml( "page_content", _httpRequestObj.responseText);
		showProperties( currentPropPage.getTypeID( ), currentPropPage.getTabID( ) );
		//fadeIn( .5, "page_content" );
		_httpRequestObj = null;
	},
	startRequest:function( content_id ) {
	   var transaction = YAHOO.util.Connect.asyncRequest('GET', "include/content_creator.php?content_id=" + content_id, content_callback, null);
	},
	startPropertiesRequestUrl:function( url ) {
	   var transaction = YAHOO.util.Connect.asyncRequest('GET', url, properties_content_callback, null);
	}
};

var PropertiesAjaxObject = {
	_httpRequestObj:null,
	handleSuccess:function(o){
		_httpRequestObj = o;
		this.processResult( );
	},
	handleFailure:function(o){
		alert("failed: " + o.responseText);
	},
	processResult:function(){
		writeInnerHtml( "properties_container", _httpRequestObj.responseText);
		fadeIn( .5, "properties_container" );
		_httpRequestObj = null;
	},
	startRequest:function( propType ) {
	   var transaction = YAHOO.util.Connect.asyncRequest('GET', "include/wa_xml.php?type=" + propType + "&status=" + currentPropPage.getStatusID( ) + "&agentid=" + currentPropPage.getAgentID( ), callback, null);
	},
	startDetailRequest:function( id ) {
		var transaction = YAHOO.util.Connect.asyncRequest('GET', "include/wa_xml.php?id=" + id + "&status=" + currentPropPage.getStatusID( ) + "&agentid=" + currentPropPage.getAgentID( ), callback, null);
	}
};

var content_callback = {
	success:ContentAjaxObject.handleSuccess,
	failure:ContentAjaxObject.handleFailure,
	scope:ContentAjaxObject
};

var properties_content_callback = {
	success:ContentAjaxObject.handlePropertiesSuccess,
	failure:ContentAjaxObject.handleFailure,
	scope:ContentAjaxObject
};

var callback = {
	success:PropertiesAjaxObject.handleSuccess,
	failure:PropertiesAjaxObject.handleFailure,
	scope:PropertiesAjaxObject
};

function fadeIn( period, element_id ){
	//Transparency.animate( element_id, 0, 100, 1000);
	//var myAnim = new YAHOO.util.Anim(element_id, { opacity: { to: 1 } }, period, YAHOO.util.Easing.easeIn);
    //myAnim.animate();
}

function fadeOut( period, element_id ){
	//Transparency.animate( element_id, 100, 0, 1000);
	//var myAnim = new YAHOO.util.Anim(element_id, { opacity: { to: 0 } }, period, YAHOO.util.Easing.easeOut);
   	//myAnim.animate();
}

function fadeOutWithCallback( period, callback, element_id ){
	//var myAnim = new YAHOO.util.Anim(element_id, { opacity: { to: 0 } }, period, YAHOO.util.Easing.easeOut);
	//myAnim.onComplete.subscribe( callback );
   	//myAnim.animate();
}

function showProperties( propType, tabID ) {
	try {
		currentPropPage.setTypeID( propType )
		if ( currentPropPage.getTabID( ) ) {
			getElement( currentPropPage.getTabID( ) ).className = "tab2";
		}
		currentPropPage.setTabID( tabID );
		if ( currentPropPage.getTabID( ) ) {
		    getElement( currentPropPage.getTabID( ) ).className = "tab2_on";
		}
		fadeOut( .25, "properties_container" )
		PropertiesAjaxObject.startRequest( propType );
	}
	catch( err ) {
		alert( err );
	}
}

function showDetail( id ) {
	try {
		fadeOut( .25, "properties_container" )
		PropertiesAjaxObject.startDetailRequest( id );
	}
	catch( err ) {
		alert( err );
	}
}

function showDetailForSlideshowItem( id ) {
	try {
	    soldPropPage.setTypeID( -1 );
	    loadPageContent( 5 );
	    showDetail( id );
	}
	catch( err ) {
		alert( err );
	}
}

function imageChanger( url, id ) {
	setImageSrc( id, url );
}

function loadPageContent( content_id ) {
        //writeInnerHtml( "page_content", '<div style="text-align:center"><img id="surface" src="images/slideshow/Loading.gif" border="0"/></div>');
	try{
		//fadeOut( .25, "page_content" )
		changeNavigationElementBg( content_id );
		setPageContentID( content_id );
		switch( content_id ) {
			default:
				ContentAjaxObject.startRequest( content_id );
				break;
		    case 1:
		        ContentAjaxObject.startRequest( content_id );
		        slideshow.play('slideshow');
				break;
			case 4:
				currentPropPage = forSalePropPage;
				ContentAjaxObject.startPropertiesRequestUrl( "content/forsale.php" );
				break;
			case 5:
				currentPropPage = soldPropPage;
				ContentAjaxObject.startPropertiesRequestUrl( "content/sold.php" );
				break;
		}
	}
	catch( err ) {
		alert( "loadPageContent error:\n[" + err  + "]" );
	}
}

var page_content_id;

function getPageContentID( ) {
    return page_content_id;
}

function setPageContentID( id ) {
    page_content_id = id;
}

function changeNavigationElementBg( id ) {
    if ( getPageContentID( ) ) {
        getElement( getPageContentID( )+ "n" ).className= "head_nav_link";
    }
    getElement( id + "n" ).className= "selected_head_nav_link";
}

-->
