function ToggleDiv(divName, imgElement, baseImgUrl)
{
    var div = document.getElementById(divName);
    if (div.style.display == "none")
    {
        div.style.display = "block";
        imgElement.src = '/companies-properties/assets/images/togglehide_' + baseImgUrl + '_over.gif';
    }
    else
    {
        div.style.display = "none";
        imgElement.src = '/companies-properties/assets/images/toggleshow_' + baseImgUrl + '_over.gif'; 
    }
}

    
function imgRollOver(imgElement, suffix) 
{
	var imgPath = imgElement.src;
	var lastFive = imgPath.substring(imgPath.length - 9, imgPath.length - 4);
	if (lastFive == suffix)
	{
		imgElement.src = imgPath.replace(suffix, '');
	} 
	else
	{
		var imgName = imgPath.substring(0,imgPath.length - 4);
		imgElement.src = imgName + suffix + ".gif";
	}
}


// **************************************************************************************************************
/***********************************************
* Disable select-text script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
* Modified here to exclude form tags properly, cross browser by jscheuer1
***********************************************/

//form tags to omit:
var omitformtags=["input", "textarea", "select"];

function disableselect(e){
    for (i = 0; i < omitformtags.length; i++)
        if (omitformtags[i]==(e.target.tagName.toLowerCase()))
            return;
    return false;
}

function reEnable(){
    return true;
}

function ds(){
    if (typeof document.onselectstart!="undefined"){
        document.onselectstart=new Function ("return false");
        
        if (document.getElementsByTagName){
            tags=document.getElementsByTagName('*');
            for (j = 0; j < tags.length; j++){
                for (i = 0; i < omitformtags.length; i++)
                if (tags[j].tagName.toLowerCase()==omitformtags[i]){
                    tags[j].onselectstart=function(){document.onselectstart=new Function ('return true');}
                    
                    if (tags[j].onmouseup!==null){
                        var mUp=tags[j].onmouseup.toString();
                        mUp='document.onselectstart=new Function (\'return false\');\n'+mUp.substr(mUp.indexOf('{')+2,mUp.lastIndexOf('}')-mUp.indexOf('{')-3);
                        tags[j].onmouseup=new Function(mUp);
                    }else{
                        tags[j].onmouseup=function(){
                            document.onselectstart=new Function ('return false');
                        }
                    }
                }
            }
        }
    }else{
        document.onmousedown=disableselect;
        document.onmouseup=reEnable;
    }
}


// **************************************************************************************************************





