function zoomIn(image, imWidth, imHeight, param) {
	if (param==undefined) {
		param=150;
	}
	if (image.width==imWidth) {
		new Effect.Scale(image, param, {scaleX: true, scaleY: true, scaleFromCenter: true, scaleMode: {originalHeight: imHeight, originalWidth: imWidth}});
	}
}

function zoomOut(image, imWidth, imHeight, param) {
	if (param==undefined) {
		param=100;
	}
	new Effect.Scale(image, param, {scaleX: true, scaleY: true, scaleFromCenter: true, scaleMode: {originalHeight: imHeight, originalWidth: imWidth}});
}

function show(id) {
	document.getElementById(id).style.display='block';
}

function hide(id) {
	document.getElementById(id).style.display='none';
}

function colorize(id,hex) {
	document.getElementById(id).style.color=hex;	
}

//ajax request to get property lists
function getProductSearch(xmlfeed,search_id,element) {
	var xmlhttp = false;
	var xmlresponse = '';
	var xmlroot = false;
	
	document.getElementById('psearch').value = search_id;
	
	//Firefox
	if (document.implementation.createDocument) {
		xmlhttp = new XMLHttpRequest();
		try {
		 xmlhttp.open("GET", xmlfeed, false);
		} catch (e) {
		//Patch for firefox3 users:
		 netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
		 xmlhttp.open("GET", xmlfeed, false);
		}
		xmlhttp.send(null);
		if (xmlhttp.readyState == 4) {
			xmlresponse = xmlhttp.responseXML;
		}
	//IE7
	} else if (window.XMLHttpRequest) {
		xmlhttp = new XMLHttpRequest();
		xmlhttp.open("GET", xmlfeed, false);
		xmlhttp.send(null);
		if (xmlhttp.readyState == 4) {
			xmlresponse = xmlhttp.responseXML;
		}
	//IE5, IE5.5, IE6
	} else if (window.ActiveXObject) {
		xmlhttp = new ActiveXObject("Microsoft.XMLDOM");
		xmlhttp.async = false;
		xmlhttp.load(xmlfeed);		
		xmlresponse = xmlhttp;
	}
	
	if (typeof(xmlresponse)=='object' && typeof(xmlhttp)=='object') {	

		xmlroot = xmlresponse.getElementsByTagName("psearch")[0];
	
		var option_id = false;
		var option_name = false;
		var option_selected = false;

		var objContainer = document.getElementById('psearch_container');

		if (objContainer.lastChild.name && objContainer.lastChild.name != element) {
		 while (objContainer.lastChild.name != element) {
		   objContainer.removeChild(objContainer.lastChild);
		 }
		}
		
		if (document.getElementById('psearch_dropdown_'+search_id)) {
			var objDropdown = document.getElementById('psearch_dropdown_'+search_id);
		} else {
			var objDropdown = document.createElement('select');
			if (xmlroot.getElementsByTagName("option").length>1) {			
			objDropdown.name = 'psearch_dropdown_'+search_id;
			objDropdown.id = 'psearch_dropdown_'+search_id;
			objDropdown.onchange = function(){getProductSearch(xmlfeed+'&psearch='+this.options[this.selectedIndex].value,this.options[this.selectedIndex].value,this.name);}
			objContainer.appendChild(objDropdown);
			}
		}		

		objDropdown.length = 0;

		if (xmlroot.getElementsByTagName("option").length>1) {

		for (i=0; i<xmlroot.getElementsByTagName("option").length; i++) {
			
			option_id = xmlroot.getElementsByTagName("id")[i].firstChild.nodeValue;
			option_name = xmlroot.getElementsByTagName("name")[i].firstChild.nodeValue;
			option_selected = xmlroot.getElementsByTagName("selected")[i].firstChild.nodeValue;		
			if (option_selected=='1') {
				option_selected = true;
			} else {
				option_selected = false;
			}
			
			var objOption = new Option(option_name, option_id, option_selected);
			objDropdown.options[objDropdown.length] = objOption;
			
		}

		}
	} 
}