function winopen(url, winname, width, height)
{
	var popup = window.open(url,winname,'toolbar=no,location=no,menubar=no,scrollbars=yes,width='+width+',height='+height+',resizable=yes,status=no');
	popup.focus();
}

function popup(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

function toggle(sObjId)
{
	if(oObj = document.getElementById(sObjId))
	{	
		oObj.style.display = (oObj.style.display=='block') ? 'none' : 'block';
	}
}

function pop_check_out()
{
	window.opener.location = 'index.php?sid=13';
	window.close();
	window.opener.focus();
	return false;
}

function check_this_form()
{
	args = check;//check_this_form.arguments;
	
	var ret = new Array();
	
	for (i=0; i<(args.length); i++)
	{	
		if((o = document.getElementById(args[i])) && args[i] != 'to')
		{
			if(o.value == '')
			{
				// fout
				o.style.backgroundColor = "#DDDDDD";
				ret[ret.length] = false;
			}
			else
			{
				// goed
				o.style.backgroundColor = "#FFFFFF";
			}
		}
	}
	
	if(ret.length > 0)
	{
		if(o = document.getElementById('form_error_report'))
		{	
			o.innerHTML = 'De gemarkeerde velden zijn verplicht om in te vullen.';
		}
		
		return false;
	}
	else
	{
		return true;
	}
}

function winopen(url, winname, width, height)
{
	var popup = window.open(url,winname,'toolbar=no,location=no,menubar=no,scrollbars=yes,width='+width+',height='+height+',resizable=yes,status=no');
	popup.focus();
}

// SEARCH CONTROL 
function doSiteSearch()
{
    var searchText = document.forms[0].txtSiteSearch.value;
    if( "Search" !=  searchText && "" != searchText)
    {
        var url = "http://www.colliers.com/Markets/Amsterdam/Search/?tx0=query+language%3aen&op0=%2B&ty0=w&fl0=&lk=1&ws=0&nh=10&rf=0&charset=utf-8&la=en";
        var re =  /query/gi;
        var searchUrl = url.replace(re,encodeURI(searchText));
        window.location.href = searchUrl;
    }
}

function submitSiteSearch()
{

	if (event.keyCode == 13)
	{
		document.forms[0].onsubmit = onSubmitSiteSearch;
		doSiteSearch();
	}
}

function onSubmitSiteSearch()
{
	return false;
}

function onSiteSearchFocus()
{
	document.forms[0].txtSiteSearch.select();
}

//IE HACK PNG

//var arVersion = navigator.appVersion.split("MSIE")
//var version = parseFloat(arVersion[1])

//function fixPNG(myImage) 
//{
//   if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
//    {
//       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
//	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
//	   var imgTitle = (myImage.title) ? 
//		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
//	   var imgStyle = "display:inline-block;" + myImage.style.cssText
//	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
//                  + " style=\"" + "width:" + myImage.width 
//                  + "px; height:" + myImage.height 
//                  + "px;" + imgStyle + ";"
//                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
//                 + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
//	   myImage.outerHTML = strNewHTML	  
//    }
//}
