var dom = (!document.all && document.getElementById);
var req;

function showHideWindow(){
    var args = showHideWindow.arguments;
    var window = document.getElementById(args[0]);
    if(window.style.visibility == "hidden"){
        window.style.visibility = "visible";
        window.style.height = "";
        
    }
    else{
        window.style.visibility = "hidden"
        window.style.height = "0px";
    }
}

function updatePage(){
	var args = updatePage.arguments;
	req = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
	if(req){
		req.onreadystatechange = processReqChange;
		req.open("GET", args[0], true);
		req.send(null);
	}
}

function processReqChange() {
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
			var tempDoc = document.getElementById("container").innerHTML;
			document.getElementById("container").innerHTML = req.responseText;
			var tempID = document.getElementById("content").innerHTML;
			document.getElementById("container").innerHTML = tempDoc;
			document.getElementById("content").innerHTML = tempID;
        } else {
            alert("There was a problem retrieving the XML data:\n" +
                req.statusText);
        }
    }
}

function setFlashSetting(cookieName, cookieValue){
		  	     var nDays = 300;
		  	     var today = new Date();
		  	     var expire = new Date();
		  	     if (nDays==null || nDays==0) nDays=1;
		  	     expire.setTime(today.getTime() + 3600000*24*nDays);
		  	     document.cookie = cookieName+"="+escape(cookieValue)
			     + ";path=/;domain="+getDomain()+";expires="+expire.toGMTString();
}

function getDomain(){
			    var wl =document.URL;
			    var sDomain = "break.com";
			    sDomain = (wl.indexOf('http')!=-1)?wl.substring(wl.indexOf('://')+3,wl.indexOf('.com') + 4):sDomain;
			    if(sDomain.split('.').length > 2)
			    {
			       sDomain = sDomain.substring(sDomain.indexOf('.'), sDomain.length);
			    }
			    return sDomain;
}
