//<![CDATA[
function Highlight_jq(elem,color0,color1,duration){
	$(elem).css('background-color',color0);$(elem).animate({backgroundColor:color1},duration);
};

function SICM_popWin (theURL) {
  var newWin = window.open(theURL, 'pageInfo', 'location=1,status=1,scrollbars=1,resizable=1,toolbar=1,width=770,height=540');
}

function SICM_gotoDetailPage(mlsDetailLink, savedSearchID, sortBy, detOffset) {
	var detForm = document.forms['frmDetail' + savedSearchID];
	
	detForm.searchid.value = savedSearchID;
	detForm.sortby.value = sortBy;
	detForm.detoffset.value = detOffset;
	
	detForm.action = mlsDetailLink;
	detForm.submit();
}

function showmoreOpenHouseInfo(mls,mlsregionid){

	if ((mls != '') && (mlsregionid != '')) {

		var open_house_loading = $('#open_house_loading' + mls);
		var open_house_info = $('#open_house_info' + mls);
		
		open_house_info.hide('fast');
		open_house_loading.show('fast');
		
		
		$.ajax({
			type: 'POST',
			url: '/property-search/sist_ajax/open_houses.asp',
			data: 'mls='+mls+'&mlsregionid='+mlsregionid,
			dataType:'text',
			error:function(data,mes1,tperr){
				open_house_info.html('No additional Open Houses were found for this listing.');
				
				open_house_loading.hide('fast');
				open_house_info.slideDown('fast');
				Highlight_jq(open_house_info,highlight_startcolor,highlight_endcolor,0.7);
			},			
			success: function(data){
				open_house_info.html(data);	
				open_house_loading.hide('fast');
				open_house_info.slideDown('fast');
				Highlight_jq(open_house_info,highlight_startcolor,highlight_endcolor,0.7);
			}
		});	
	}
}

function hideOpenHouseInfo(mls,mlsregionid){
	if ((mls != '') && (mlsregionid != '')) {
		var open_house_info = $('#open_house_info' + mls);
		open_house_info.html('<a href="javascript: showmoreOpenHouseInfo(\'' + mls + '\',\'' + mlsregionid + '\');">More upcoming open houses &gt;&gt;</a>');
	}
}

function showReadMoreText(readMoreDiv,referringLink) {
	$('#' + referringLink).hide('fast');
	$('#' + readMoreDiv).slideDown('slow');
}

function hideReadMoreText(readMoreDiv,referringLink) {
	$('#' + readMoreDiv).slideUp('fast');
	$('#' + referringLink).show('fast');
}
//]]>
