﻿// JScript File
//gets a object safely between all browsers
function getElement(sID){if(document.getElementById){return document.getElementById(sID);}else if(document.all){return document.all[sID];}else if(document.layers){return document.layers[sID];}}


function HomeTabNav(){
	$('ul.tabNav a').click(function() {
		var curChildIndex = $(this).parent().prevAll().length + 1;
		$(this).parent().parent().children('.current').removeClass('current');
		$(this).parent().addClass('current');
		if ($(this).parent().parent().next('.tabContainer').children('div:nth-child('+curChildIndex+')').is(':hidden')){
		    $(this).parent().parent().next('.tabContainer').children('.current').animate({opacity:0.0},200,function() {
			    $(this).removeClass('current');
			    $(this).parent().children('div:nth-child('+curChildIndex+')').animate({opacity:1.0},200,function() {
				    $(this).addClass('current');
			    });
		    });
		}
		return false;
	});
}

 function PropertyList(hoverclass,targethrefelement){
    $('.PropertyList td').hover(
        function(){
            $(this).css('background-color',hoverclass);
        },
        function(){
            $(this).removeAttr('style');
        }
    );
    
        $('.PropertyList td').click (
            function(){
                //alert($(this).find(targethrefelement).attr('href'));  
                window.location = "/" + $(this).find(targethrefelement).attr('href');  
                
            }
        );
}