curWin= "" + window.location;
if (curWin.indexOf("http://disneyland.disney.go.com/disneyland/en_US/special/holidays/detail?name=HolidaysMiniSitep&pg=ActivitiesandGames")>-1){
	window.location = "http://disneyland.disney.go.com/disneyland/en_US/special/holidays/detail?name=HolidaysMiniSite&pg=ActivitiesandGames"
}

function closeCurWindow() {
window.close();
}

function addEvent (objTarget, strType, objFunction)  {
	if ( objTarget.addEventListener ) {
		objTarget.addEventListener(strType, objFunction, true);
		return true;
	} else if ( objTarget.attachEvent ) {
		//obj["e"+type+fn] = fn;
		//obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		var bResult = objTarget.attachEvent('on' + strType, objFunction);
		return bResult;
	} else {
		return false;
	}
}

function removeEvent( obj, type, fn ) {
	if (obj.removeEventListener) {
		obj.removeEventListener( type, fn, false );
		return true;
	} else if (obj.detachEvent) {
		obj.detachEvent( "on"+type, obj[type+fn] );
		obj[type+fn] = null;
		obj["e"+type+fn] = null;
		return true;
	} else {
		return false;
	}
}

function getElements(itemId)  {
	if (document.getElementById) {
	    objValue = document.getElementById([itemId]);
	}
	return objValue;
}
Function.prototype.bind = function(object) { 
	var __method = this; 
    return function(event) { 
    	return __method.call(object, event || window.event);
	}
}

// Function to alert users before redirecting to another site/locale
popup = window.self;
function confirmRedirect(url, text, popupProps) {
	var bAnswer = confirm(text);
	if (bAnswer) {
		// remove width and height values, if null
		popupProps = popupProps.replace("width=null,","");
		popupProps = popupProps.replace("height=null,","");
		popup = window.open(url,'new',popupProps);
		
	}
}




function openMapWindow() {
	var win = window.open('http://disneyland.disney.go.com/disneyland/en_US/map/mapSwitch?name=MapOverviewPage','new','width=603,height=400,toolbar=false,scrollbars=yes,menubar=no,status=false,location=no,resizable=yes');
}

function replaceLogin() {
	document.getElementById("modulecontainer").style.display = "block";
	document.getElementById("modulecontainer2").style.display = "none";
}
	
function replaceRegister() {
	document.getElementById("modulecontainer2").style.display = "block";
	document.getElementById("modulecontainer").style.display = "none";
}

function createPopupAndCenter(strLocation, strWindowName, intWidth, intHeight, strResizable, strScrollbars, strStatus, strToolbar, strLocationBar, strMenuBar){
	var strParams = "";
	var strDelimiter = "";
	xPosition = (screen.width - intWidth ) / 2;
	yPosition = (screen.height - intHeight ) / 2;
	// build param list
	
	// popup width param
	if(intWidth != null && intWidth != ""){
		strParams = strParams + "width=" + intWidth;
	}
	
	// popup height param
	if(intHeight != null && intHeight != ""){
		if(strParams.length > 0){
			strDelimiter = ", ";
		}else{
			strDelimiter = "";
		}
		strParams = strParams + strDelimiter + "height=" + intHeight;
	}
	
	// popup top (y-position) param
	if(yPosition != null && yPosition != ""){
		if(strParams.length > 0){
			strDelimiter = ", ";
		}else{
			strDelimiter = "";
		}
		strParams = strParams + strDelimiter + "top=" + yPosition;
	}
	
	// popup left (x-position) param
	if(xPosition != null && xPosition != ""){
		if(strParams.length > 0){
			strDelimiter = ", ";
		}else{
			strDelimiter = "";
		}
		strParams = strParams + strDelimiter + "left=" + xPosition;
	}
	
	// popup resizable param
	if(strResizable != null && strResizable != ""){
		if(strParams.length > 0){
			strDelimiter = ", ";
		}else{
			strDelimiter = "";
		}
		strParams = strParams + strDelimiter + "resizable=" + strResizable;
	}
	
	// popup scrollbars param
	if(strScrollbars != null && strScrollbars != ""){
		if(strParams.length > 0){
			strDelimiter = ", ";
		}else{
			strDelimiter = "";
		}
		strParams = strParams + strDelimiter + "scrollbars=" + strScrollbars;
	}
	
	// popup status param
	if(strStatus != null && strStatus != ""){
		if(strParams.length > 0){
			strDelimiter = ", ";
		}else{
			strDelimiter = "";
		}
		strParams = strParams + strDelimiter + "status=" + strStatus;
	}
	
	// popup toolbar param
	if(strToolbar != null && strToolbar != ""){
		if(strParams.length > 0){
			strDelimiter = ", ";
		}else{
			strDelimiter = "";
		}
		strParams = strParams + strDelimiter + "toolbar=" + strToolbar;
	}
	
	// popup location bar param
	if(strLocationBar!= null && strLocationBar != ""){
		if(strParams.length > 0){
			strDelimiter = ", ";
		}else{
			strDelimiter = "";
		}
		strParams = strParams + strDelimiter + "location=" + strLocationBar;
	}
	
	// popup menu bar param
	if(strMenuBar != null && strMenuBar != ""){
		if(strParams.length > 0){
			strDelimiter = ", ";
		}else{
			strDelimiter = "";
		}
		strParams = strParams + strDelimiter + "menubar=" + strMenuBar;
	}
	
	var objPopup = window.open(strLocation, strWindowName, strParams);

	if ((document.window != null) && (!objPopup.opener)){
		objPopup.opener = document.window;
	}
}