
	function changeObjectClass(obj, new_style) {		obj.className = new_style;	}	
	function MM_openBrWindow(theURL,winName,features) { //v2.0	  window.open(theURL,winName,features);	}		function setimage(i) {				if (i >= 0) {			if (i < imagearray.length) {				pointer = i;				document.developmentimg.src = imagearray[pointer].src;				//document.getElementById("imagenumber").innerHTML = pointer + 1;				//document.getElementById("imagename").innerHTML = pointer + 1 + ". " + namearray[pointer];			}		}//		document.form.imagenumber.value = pointer + 1;//		document.titleform.imagename.value = namearray[pointer];	}		function nextimage() {		var i = pointer + 1;				if (i < imagearray.length) {			pointer = i;			document.developmentimg.src = imagearray[pointer].src;			document.developmentimg.title = namearray[pointer];			document.developmentimg.alt = namearray[pointer];			//document.getElementById("imagenumber").innerHTML = pointer + 1;			//document.getElementById("imagename").innerHTML = namearray[pointer];		}//		document.form.imagenumber.value = pointer + 1;//		document.titleform.imagename.value = namearray[pointer];	}		function previmage() {				var i = pointer - 1;				if (i >= 0) {			pointer = i;			document.developmentimg.src = imagearray[pointer].src;			document.developmentimg.title = namearray[pointer];			document.developmentimg.alt = namearray[pointer];			//document.getElementById("imagenumber").innerHTML = pointer + 1;			//document.getElementById("imagename").innerHTML = namearray[pointer];		}//		document.form.imagenumber.value = pointer + 1;//		document.titleform.imagename.value = namearray[pointer];	}		function showimage() {				if (pointer >= 0) {			MM_openBrWindow(imagearray[pointer].src,"ImageViewer","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=655,height=480");		}			}
	
	function f_openMediaViewer(url,isdev,gid,id,mid) {
		
		// http://v2.bulgaria-property.com/mplayer/property/bulgaria/bourgas_region/sunny_beach/development/1.cntns

		var theurl = "/mplayer/" + url + "/" + id + ".cntns";
		
		if (gid) theurl = theurl + "?gid=" + gid;
		if (mid) {
			if (gid) theurl = theurl + "&mid=" + mid;
			else theurl = theurl + "?mid=" + mid;
		}
		
		MM_openBrWindow(theurl,'mediaviewer','status=no,scrollbars=no,resizable=no,width=660,height=500');
	
	}
	
	function f_selectAllOpts(id) {
		
		var select = document.getElementById(id);
		var c = select.options.length;
		
		for (var i = 0; i < c; i++) {
			select.options[i].selected = true;
		}
		
		//return true;
	}	
	function f_deselectAllOpts(id) {
		
		var select = document.getElementById(id);
		var c = select.options.length;
		
		for (var i = 0; i < c; i++) {
			select.options[i].selected = false;
		}
		
		//return true;
	}

	function setWidth(o,oWidth) {
		o.style.width = oWidth + "px";
	}
	
	function setHeight(o,oHeight) {
		o.style.height = oHeight + "px";
	}
	
	function setSize(o,oWidth,oHeight) {
		setWidth(o,oWidth);
		setHeight(o,oHeight);
	}

	function resizeWindow(width,height) {
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
			
			
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		/*alert(myWidth);
		alert(myHeight);*/
		
		if (myWidth != width || myHeight != height) {
			/*alert("foo");
			window.toolbar.visible=false;
			self.toolbar.visible=false*/
			if( typeof( window.innerWidth ) == 'number' ) {
				window.innerWidth = width;
				window.innerHeight = height;
			} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {			
				window.resizeTo(width,height);
				//document.documentElement.clientWidth = width;
				//document.documentElement.clientHeight = height;
				myWidth = document.documentElement.clientWidth;
				myHeight = document.documentElement.clientHeight;
				//alert(myWidth + " " + myHeight);
				window.resizeBy(width - document.documentElement.clientWidth,height - document.documentElement.clientHeight - 20);
			} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
				document.body.clientWidth = width;
				document.body.clientHeight = height;
			}
		}
		// alert(myWidth + " x " + myHeight);
	}

	function setWindowSize() {
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		
		if (myWidth != 660 || myWidth != 500) {
			setSize();
		}
		// alert(myWidth + " x " + myHeight);
	}
	
