
<!--

function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
}

function openCenterWindow(file, name, width, height, options) {
	leftVal = (screen.width - width) / 2;
	topVal = (screen.height - height) / 2;
	
	if(typeof(popupWin) != "Object") {
		popupWin = window.open(file, name, 'width='+width+',height='+height+',left='+leftVal+',top='+topVal+','+options);
	}
	else {
		if(!popupWin.closed) {
			popupWin.location.href = file;
		}
		else {
			popupWin = window.open(file, name, 'width='+width+',height='+height+',left='+leftVal+',top='+topVal+','+options);
		}
	}
	popupWin.focus();

}

function loadOverlay() {
	if (window.innerHeight && window.scrollMaxY || window.innerWidth && window.scrollMaxX) {
	yScroll = window.innerHeight + window.scrollMaxY;
	xScroll = window.innerWidth + window.scrollMaxX;
	var deff = document.documentElement;
	var wff = (deff&&deff.clientWidth) || document.body.clientWidth || window.innerWidth || self.innerWidth;
	var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight;
	xScroll -= (window.innerWidth - wff);
	yScroll -= (window.innerHeight - hff);
	} else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){ // all but Explorer Mac
	yScroll = document.body.scrollHeight;
	xScroll = document.body.scrollWidth;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
	yScroll = document.body.offsetHeight;
	xScroll = document.body.offsetWidth;
  }
	
    var overlay = document.getElementById("TB_overlay");	
    overlay.style.height = yScroll+"px";
    overlay.style.width = xScroll+"px";
    overlay.style.display = "block";
}

function unloadOverlay(form) {
	var overlay = form.getElementById("TB_overlay");
	if(overlay != null) {	
		overlay.style.height = "0px";
		overlay.style.width = "0px";
		overlay.style.display = "none";
	}
}

function signUp() {
	var filter = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
	if(filter.test(document.getElementById("txtSndEmail").value)) {
		loadOverlay();
		eval("loadwindow('http://meetingsinthewest.com/popup/emailsignup2.aspx?email=" + document.getElementById("txtSndEmail").value + "',300,480,230,190);");
		return false;
	}
	else {
		return false;
	}
	

}

function search() {
	if(Trim(document.getElementById("txtSearchText").value).length != 0) {
		window.location.href = "http://meetingsinthewest.com/search.aspx?SearchType=all&SearchTerm=" + escape(document.getElementById("txtSearchText").value)
	}
}

function thankYouClose() {
	
	if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
		var theform = window.parent.document;
	    if(theform.getElementById("dwindow") == null) {
			window.location = "http://meetingsinthewest.com/";
	    }
	    else {
			unloadOverlay(theform);
			theform.getElementById("dwindow").style.display="none";
		}
	}
	else {
	    var par = top.document;
	    if(par.getElementById("dwindow") == null) {
			window.location = "http://meetingsinthewest.com/";
	    }
	    else {
			unloadOverlay(par);
			par.getElementById("dwindow").style.display="none";
		}
	}
}

function loadRFP(id, box, typ) {  
	loadOverlay();
	var src = getQueryVariable("source");
	if(src == null) {
		eval("loadwindow('http://meetingsinthewest.com/popup/rfpIframe.aspx?htid=" + box + "&type=" + typ + "',600,420,320,190);");
	} else {
		eval("loadwindow('http://meetingsinthewest.com/popup/rfpIframe.aspx?htid=" + box + "&type=" + typ + "&source="+src+"',600,420,320,190);");
	}
	
}

function loadWed(id,id2) {
	var src = getQueryVariable("source");
	if(src == null) {
		eval("loadwindow('http://meetingsinthewest.com/popup/rfpWedding.aspx?htid=" + id + "&wid=" + id2 + "',600,420,320,190);");
    } else {
		eval("loadwindow('http://meetingsinthewest.com/popup/rfpWedding.aspx?htid=" + id + "&wid=" + id2 + "&source="+src+"',600,420,320,190);");
    }
}

function clearRFP() {
	window.pkFrom1.ClearSelectedDate();
	window.pkFrom2.ClearSelectedDate();
	window.pkTo1.ClearSelectedDate();
	window.pkTo2.ClearSelectedDate();
}
function loadGrpRFP(htid, eid) {
	loadOverlay();
	eval("loadwindow('http://meetingsinthewest.com/popup/rfpIframe.aspx?htid=" + htid + "&eid=" + eid + "&type=event',600,420,320,190);");
}
function loadCalOver(box) {
	var idx1 = box.parentNode.id.indexOf("calPriceSel");
	var cl = box.parentNode.id.substring(0, idx1);
	
	var cln = box.parentNode.className;
	//alert(cln.indexOf(" "));
	cln = cln.replace(/\s+/gm, "");

	var idx = cln.substring(15);
	if(document.getElementById(cl + "priceText" + idx).value != "") {
		ddrivetip(document.getElementById(cl + "priceText" + idx).value, document.getElementById(cl + "priceDesc" + idx).value);
	}
}

function Trim(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}

function replaceSrchType() {
    if(document.getElementById("dvSearchMain") != null) {
        var dv = document.getElementById("dvSearchMain");
		for(i=0; i<dv.childNodes.length; i++) {
			//alert(dv.childNodes[i].nodeName);
			if(dv.childNodes[i].nodeName == "#text") {
				if(Trim(dv.childNodes[i].nodeValue) == "Search technology powered by") {
					dv.removeChild(dv.childNodes[i]);
				}
			}
			
			if(dv.childNodes[i].nodeName == "A") {
				dv.removeChild(dv.childNodes[i]);
			}
		}
		//alert(document.getElementById("dvSearchMain").childNodes.length);
    }

	if(document.getElementById("Search_ResultsDataGrid") != null) {
		var allspan = document.getElementById("Search_ResultsDataGrid").getElementsByTagName("SPAN");
		for(i=0; i<allspan.length; i++) {
			if(allspan[i].id == "lblType") {
				if(allspan[i].innerHTML == "Html") {
					allspan[i].innerHTML = "<img src='icons/htm.gif' border='0' />"
				}
				else if(allspan[i].innerHTML == "PDF") {
					allspan[i].innerHTML = "<img src='icons/pdf.gif' border='0' />"
				}
			}
		}
	}
}

function selectAllHotels(box) {
	var p = box.parentNode.parentNode.getElementsByTagName("INPUT");
	var l = box.checked;
	for(i=0;i<p.length;i++) {
		p[i].checked = l;
	}
}


function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}





//DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
//For full source code, documentation, and terms of usage,
//Visit http://www.dynamicdrive.com/dynamicindex9/dhtmlwindow.htm

var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+e.clientY-offsety+"px"
}
}

function initializedrag(e){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
document.getElementById("dwindowcontent").style.display="none" //extra
tempx=parseInt(document.getElementById("dwindow").style.left)
tempy=parseInt(document.getElementById("dwindow").style.top)

dragapproved=true
document.getElementById("dwindow").onmousemove=drag_drop
}

function loadwindow(url,width,height,top,left){
if (!ie5&&!ns6)
window.open(url,"","width=width,height=height,scrollbars=1")
else{
document.getElementById("dwindow").style.display=''
document.getElementById("dwindow").style.width=initialwidth=width+"px"
document.getElementById("dwindow").style.height=initialheight=height+"px"
//document.getElementById("dwindow").style.left="30px"
//document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30+"px" : iecompattest().scrollTop*1+30+"px"

document.getElementById("dwindow").style.left=left+"px";
var ht;
if(ns6) {
	ht = (window.pageYOffset*1)-150 + top;
}
else {
	ht = (iecompattest().scrollTop*1)-100 + top;
}

if(ht < 320)
	ht = 320;
	
	
document.getElementById("dwindow").style.top= ht;
//alert(iecompattest().scrollTop*1+ top +"px");
//document.getElementById("dwindow").style.left=left+"px"
//document.getElementById("dwindow").style.top=ns6? top +"px" : top +"px"


document.getElementById("cframe").src=url
}
}

function maximize(){
if (minrestore==0){
minrestore=1 //maximize window
document.getElementById("maxname").setAttribute("src","restore.gif")
document.getElementById("dwindow").style.width=ns6? window.innerWidth-20+"px" : iecompattest().clientWidth+"px"
document.getElementById("dwindow").style.height=ns6? window.innerHeight-20+"px" : iecompattest().clientHeight+"px"
}
else{
minrestore=0 //restore window
document.getElementById("maxname").setAttribute("src","max.gif")
document.getElementById("dwindow").style.width=initialwidth
document.getElementById("dwindow").style.height=initialheight
}
document.getElementById("dwindow").style.left=ns6? window.pageXOffset+"px" : iecompattest().scrollLeft+"px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset+"px" : iecompattest().scrollTop+"px"
}

function closeit(){
unloadOverlay(document);
document.getElementById("dwindow").style.display="none"
}

function stopdrag(){
dragapproved=false;
document.getElementById("dwindow").onmousemove=null;
document.getElementById("dwindowcontent").style.display="" //extra
}



function expcolDiv(num) {
    //alert("bbbb");
	if(document.getElementById("dv" + num).className == "dvExpColOut") {
		document.getElementById("lblIcon" + num).className = "stExpIcon";
		document.getElementById("dv" + num).className = "dvExpColOver";
	}
	else {
		document.getElementById("lblIcon" + num).className = "stColIcon";
		document.getElementById("dv" + num).className = "dvExpColOut";
	}
}

function openSpclDiv() {
  var loc = window.location.toString();
  var idx = window.location.toString().indexOf("#");
  var hash = window.location.hash.substring(1);
  //alert(hash);
  
  if(idx > 0) {
	var specials = document.getElementById("specialsArea").getElementsByTagName("P");
	var pItem;
	for(var i=0; i<specials.length; i++) {
		if(specials[i].id == hash) {
			var cl = specials[i].parentNode.parentNode.id.substring(2);
			specials[i].parentNode.parentNode.className = "dvExpColOver";
			document.getElementById("lblIcon" + specials[i].parentNode.parentNode.id.substring(2)).className = "stExpIcon";
			window.location = loc;
			break;
		}
	}
  }
}







function openSpecial(sp) {
  /*if(window.location.pathname == "/default.aspx") {
	window.location.href = "http://www.gowestmarriott.com/specials.aspx#sp" + sp;
  }
  else if(window.location.pathname == "/specials.aspx") {
	var specials = document.getElementById("specialsArea").getElementsByTagName("P");
	var pItem;
	for(var i=0; i<specials.length; i++) {
		if(specials[i].id == "sp" + sp) {
			var cl = specials[i].parentNode.parentNode.id.substring(2);
			specials[i].parentNode.parentNode.className = "dvExpColOver";
			document.getElementById("lblIcon" + specials[i].parentNode.parentNode.id.substring(2)).className = "stExpIcon";
			window.location = "http://www.gowestmarriott.com/specials.aspx#sp" + sp;
			break;
		}
	}
  }
  else {
	window.location.href = "http://www.gowestmarriott.com/specials.aspx#sp" + sp;
  }*/
  
  loadRFP(this,sp,'event');
  
}


function openEvPlnDiv() {
  var loc = window.location.toString();
  var idx = window.location.toString().indexOf("#");
  var hash = window.location.hash.substring(1);
  //alert(hash);
  
  if(idx > 0) {
	if(hash == "expand") { 
		//alert("bbbb");
		var specials = document.getElementById("stateArea").getElementsByTagName("p");
		var pItem;
		//alert(specials.length);
		for(var i=0; i<specials.length; i++) {
			//alert(specials[i].parentNode.className);
			if(specials[i].className == "bluText fwBold fs12px nm") {
				specials[i].parentNode.parentNode.className = "dvExpColOver";
				document.getElementById("lblIcon" + specials[i].parentNode.parentNode.id.substring(2)).className = "stExpIcon";
			}
		}
		//window.location = loc;
	}
	else {
		var specials = document.getElementById("stateArea").getElementsByTagName("P");
		var pItem;
		for(var i=0; i<specials.length; i++) {
			if(specials[i].id == hash) {
				var cl = specials[i].parentNode.parentNode.id.substring(2);
				specials[i].parentNode.parentNode.className = "dvExpColOver";
				document.getElementById("lblIcon" + specials[i].parentNode.parentNode.id.substring(2)).className = "stExpIcon";
				window.location = loc;
				break;
			}
		}
	}
  }
}






//-->
