
////////CustomPopUp



var BOX_TITLE = "BW SaddleBack Inn";
var oBoxalert = false;
 
if(document.getElementById) 
{    
    window.alert = function(txt) 
    {
	    createCustomBox(txt, 1);
    }
    
}
function createCustomBox(txt,objNo)
{
    d = document;

	if(d.getElementById("BoxDiv")) return;
	mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
	mObj.id = "BoxDiv";
	mObj.style.height = d.documentElement.scrollHeight + "px";
	
	BoxObj = mObj.appendChild(d.createElement("div"));
	BoxObj.id = "Box";
	BoxObj.style.top = document.documentElement.scrollTop -500 + "px";
	BoxObj.style.left = (d.documentElement.scrollWidth - BoxObj.offsetWidth)/2 + "px";
	BoxObj.style.visiblity="visible";

	h1 = BoxObj.appendChild(d.createElement("h1"));
	h1.appendChild(d.createTextNode(BOX_TITLE));
    h2 = BoxObj.appendChild(d.createElement("h2"));
	msg = BoxObj.appendChild(d.createElement("p"));
	msg.appendChild(d.createTextNode(txt));
	
	
    TblObj = document.createElement("table");
    TblBody = document.createElement("tbody");
    TR1 = document.createElement("tr");
    TD1 = document.createElement("td");
    TD2 = document.createElement("td");
    
    BoxObj.appendChild(TblObj)
    TblObj.appendChild(TblBody)
    TblBody.appendChild(TR1)
    TR1.appendChild(TD1)
    
    TblObj.id = "tblBox";
   
	btn1 = TD1.appendChild(d.createElement("img"));
	btn1.id = "OkBtn";
	btn1.src = RelativePath() + "images/btn_ok.png";
	
	
	btn1.onmouseover = function() { this.src= RelativePath()+"images/btn_ok_o.png";}
	btn1.onmouseout = function() { this.src= RelativePath()+"images/btn_ok.png";}
	
	if(objNo==2)
	{
	    TR1.appendChild(TD2)
	    TD2.style.paddingLeft = "3px";
	    
	    btn2 = TD2.appendChild(d.createElement("img"));
	    btn2.id = "CancelBtn";
	    btn2.src = "images/buttons/btn-cancel.jpg";
	    
	    btn1.onclick = function() { removeCustomAlert(); oBoxalert = true; }
	    btn2.onmouseover = function() { this.src="images/buttons/btn-cancel-o.jpg";}
	    btn2.onmouseout = function() { this.src="images/buttons/btn-cancel.jpg";}
	    btn2.onclick = function() { removeCustomAlert();return false; }
	    
	}
	else
	{
	    btn1.onclick = function() { removeCustomAlert(); var btnSubmit = document.getElementById('ctl00_cphContent_btnClickForSubmit') 
	 


 if(btnSubmit) window.location.href='bwmd_hotel-rfp';
	     return false; }
	}
	
 
	BoxObj.style.display = "block";
	
    try
    {
        var oSelect = document.all.tags("SELECT");     
		if (oSelect!=null)
		{
			for (i=0; i<oSelect.length; i++) 
			oSelect[i].style.visibility = "hidden";
		}
    }
    catch(Error){}
    
	btn1.focus();
	//if(!oBoxalert) {oBoxalert = false; return false;}
}
function removeCustomAlert() 
{
//    try
//    {
//        var oSelect = document.all.tags("SELECT");     
//		if (oSelect!=null)
//		{
//			for (i=0; i<oSelect.length; i++) 
//			oSelect[i].style.visibility = "visible";
//		}
//    }
//    catch(Error){}
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("BoxDiv"));
}


 //gets the relative root path
