toggle = function(room,linkurl) {
	var pic = new Image();
	pic.src = room;
	if ( !isImageOk(pic.src) ) {
		document.getElementById('bigImage').style.display = 'block';
		document.getElementById('bigImage').src = pic.src;
	} else {
		document.getElementById('bigImage').style.display = 'none';
	}
	createHyperlink(linkurl)
}
function isImageOk(img) {
    // During the onload event, IE correctly identifies any images
    // that weren't downloaded as not complete. Others should too.
    // Gecko-based browsers act like NS4 in that they report this
    // incorrectly: they always return true.
    if (!img.complete) {
        return false;
    }

    // However, they do have two very useful properties: naturalWidth
    // and naturalHeight. These give the true size of the image. If
    // it failed to load, either of these should be zero.
    if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) {
        return false;
    }

    // No other way of checking: assume it's ok.
    return true;
}
function createHyperlink(a)
{
var div=document.getElementById("hyperlink")
deleteprior(div)
var title=a
var text=a
var href="http://"+a
var textNode=document.createTextNode(text)
var link=document.createElement("a")
link.setAttribute("title",title)
link.setAttribute("href",href)
link.setAttribute("target","_blank")
link.appendChild(textNode)
div.appendChild(link)
}
function deleteprior(div)
{
if(div.childNodes[0])
    {
    div.removeChild(div.childNodes[0])
    }
}

/**********************************************
       DETECTING CLIENT'S BROWSER NAME
**********************************************/
var detect = navigator.userAgent.toLowerCase();
var os_ = navigator.platform.toLowerCase();
var browser,thestring;

if (checkIt('safari')) browser = "Safari"
else browser = "not Safari"

if ( os_ == 'macppc' ) os = "Mac"
else os = "not Mac"

if ( os_ == 'macppc' && checkIt('firefox')) os = "FF/Mac"

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
