//	TITLE:	prop-search.js
//	CREATED:	10/5/2004
//
//	Any page that uses a control in /propertysearch-controls needs to include this file
//	AND iberian.js


//	NAME: preloadHoverImage()
//	DESCRIPTION:
//
//	used by TextButton control
//	trys to ensure the image used to replace DIV:BACKGROUND-IMAGE has been downloaded to the client prior to any
//	onMouseOver events firing, so that in the onMouseOver event the browser should pull the image from 
//	the cache rather than the websitem which should be faster
function preloadHoverImage(url){
	var img=new Image()
	img.src=url;
}


//	NAME: changeBackground()
//	DESCRIPTION:
//
function changeBackground(thecell,theurl) {
	document.getElementById(thecell).style.background = 'url(' + theurl + ')'
}

//	NAME: loadUrl()
//	DESCRIPTION:
//
function loadUrl(url){
	window.location.href=url;
}

//	NAME: drawMainImage()
//	DESCRIPTION:
//
//	used for swapping in the supplied image into the main image div on the property details screen
function drawMainImage(url){
	
	drawImageInDiv(url,'mainpropertyimage',320,240);
	
	//only quicktime currently needs a control panel
	hideControlPanel();
}



//	NAME: showControlPanel()
//	DESCRIPTION:
//
// makes visible the div under the main image if it exists
function showControlPanel(){

	var cp=document.getElementById('mainImageControlPanel');
	if(cp!=null)cp.style.display='block';
	
}

//	NAME: hideControlPanel()
//	DESCRIPTION:
//
// hides the div under the main image if it exists
function hideControlPanel(){

	var cp=document.getElementById('mainImageControlPanel');
	if(cp!=null)cp.style.display='none';
}

//	NAME: drawQuicktime()
//	DESCRIPTION:
//
//	used for displaying any quicktime movies in the main image div on the property details screen
function drawQuicktime(url){

		//show the quicktime instruction
		showControlPanel();
		
	var qtHTML='<OBJECT id=\"mainQt\" codeBase=\"http://www.apple.com/qtactivex/qtplugin.cab\" height=\"240\" width=\"320\" classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" VIEWASTEXT>';
			qtHTML=qtHTML + ' <param name=\"src\" value=\"' + url + '\">';
			qtHTML=qtHTML + ' <param name=\"autoplay\" value=\"true\">';
			qtHTML=qtHTML + ' <param name=\"controller\" value=\"false\">';
			qtHTML=qtHTML + ' <EMBED src=\"' + url + '\" width=\"320\" height=\"240\"';                  
			qtHTML=qtHTML + ' autoplay=\"true\" CONTROLLER=\"false\"';      
			qtHTML=qtHTML + ' PLUGINSPAGE=\"http://www.apple.com/quicktime/download/\">';
			qtHTML=qtHTML + ' </EMBED>';
			qtHTML=qtHTML + ' </OBJECT>';

		document.getElementById('mainImageDiv').innerHTML=qtHTML;

		
		
	}
	
function resetPrices(selectId)
 {
	var select=document.getElementById(selectId);
	
	if(select && select.options && select.options[0])
	{
			select.options[0].selected=true;
	}		
 }

	
