function setIntro(){ document.cookie="show=N"; }
function setMovie(id){ document.cookie="Movie="+id; }

function getBase()
{
	baseTag = document.getElementsByTagName("base");
	if(baseTag != '')
	{
		baseTag = baseTag[0].href;
	}
	return baseTag;
}
function resize_elements(items)
{
	var recs = new Array();
	for(i = 0; i < items.length; i++)
	{	
		recs[i] = document.getElementById(items[i]);
	}
	
	var max = 0;
	for(i=0; i<recs.length; i++)
	{
		if(recs[i].offsetHeight > max)
		{
			max = recs[i].offsetHeight;
		}
	}
	for(i = 0; i < recs.length; i++)
	{
		recs[i].style.height = max;
	}
}
var globalPromoItems=[];
var items=[]; var subfooter='';
function write_disclaimer(){

if (globalPromoItems.length>0 || items.length>0){

document.writeln('<div align="center" id="disclaimerdiv"><div class="disclaimer" style="clear:both;">');
	document.write('<table cellpadding="1" cellspacing="0">');

for (i=0; i<globalPromoItems.length; i++){
try{
document.writeln('<tr class="noprint"><td class="sup" align="right" style="vertical-align:top;">'+globalPromoItems[i][0]+'</td><td style="padding-bottom:10px;">'+globalPromoItems[i][1]+'</td></tr>');
}catch(e){}
}

	for(i = 0; i < items.length; i++){
		document.write('<tr>'+
					'<td class="number" valign="top"><sup>'+(i+1)+'</sup></td>' +
					'<td style="padding-bottom:10px;">'+items[i]+'</td>' +
					'</tr>');
	}

if (location.href=="http://disneyrewards.disney.go.com/" || location.href=="http://disneyrewards.disney.go.com/index.html"){
document.writeln('<tr><td class="number" valign="top">&nbsp;&nbsp;</td><td style="padding-bottom:10px;">\
Offer made by Disney. Chase Bank USA, N.A. and its affiliates are not affiliates of Disney and are not responsible for offer fulfillment.\
<br><br>\
&copy; Disney\
</td></tr>');
}

document.write('</table>');

document.writeln(subfooter);
document.writeln('</div></div>');
}
}
function resizeWindow()
{	
	var type = document.body.className;
	if(type == 'footer')
	{
		var tdheight = parseInt(document.getElementById('tdtext').offsetHeight);
		var pageTopHeight = 119;
		var bottomHeight = 55;
		var other = 97;
		var total = tdheight + pageTopHeight + bottomHeight + other;
		
		if(total > 576)
		{
			total = 576;
		}
		var width = 0;
		if(BrowserDetect.browser == "Explorer")
		{
			width = 490;
		}
		else if(BrowserDetect.browser == "Firefox")
		{
			width = 480;
		}
		else if(BrowserDetect.browser == "Netscape")
		{
			width = 488;
		}
		else
		{
			width = 465;
		}
	}
	else if(type == 'print')
	{
		total = 700;
		var width = 0;
		if(BrowserDetect.browser == "Explorer")
		{
			width = 605;
		}
		else if(BrowserDetect.browser == "Firefox")
		{
			width = 595;
		}
		else if(BrowserDetect.browser == "Netscape")
		{
			width = 598;
		}
		else
		{			
			width = 580;
		}
	}
	window.resizeTo(width,total);
}
function footerPopUp(url,str)
{
	this.focus();
	day = new Date();
	id = day.getTime();
	var width = ((parseInt(str) + '') != "NaN")?parseInt(str):parseInt(450);
	baseTag = "http://disneyrewards.disney.go.com/";
	newWindow = window.open(baseTag+url, id,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,titlebar=0,copyhistory=0,width='+width+',height=576,screenX='+(screen.width - width - 50)+',screenY=0');
	
}
function printPopUp(url)
{
	var baseTag = document.getElementsByTagName("base")
	day = new Date();
	id = day.getTime();
	var width = 565;
	newWindow = window.open(baseTag[0].href+url, id,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width='+width+',height=700,screenX='+(screen.width - width - 50)+',screenY=0');
	newWindow.focus();
}
function swap(obj, newsrc)
{
	if (document.images)
	{
		obj.src = newsrc;
	}
}
function resize_iframe()
{
	moz=document.getElementById&&!document.all
	mozHeightOffset=20
	document.getElementById("myframe_i").height=100 // required for Moz bug, value can be "", null, or integer
	setTimeout("document.getElementById('myframe_i').height=parseInt(window.frames['myframe_n'].document.getElementById('hfFromTop').value)+(moz?mozHeightOffset:0)",600);
	
	
	

}
function get_query_string(qstr) 
{
	var i, pos, argname, argvalue, queryString, pairs;
	queryString = location.href.substring(location.href.indexOf("?")+1);
	pairs = queryString.split("&");
	for (i = 0; i < pairs.length; i++) 
	{
		pos = pairs[i].indexOf('=');
		if (pos == -1) 
		{
			continue;
		}
		argname = pairs[i].substring(0,pos);
		argvalue = pairs[i].substring(pos+1);
		if (argname == qstr) 
		{
			return unescape(argvalue.replace(/\+/g, " "));
		}
	}
	return false;
}
function resrc_iframe(iframeid, qstr)
{
	var iframe = document.getElementById(iframeid);
	var newpage = decode_iframe_loc(get_query_string(qstr));
	if(newpage != false)
	{
		iframe.src = newpage;
	}
}
function decode_iframe_loc(strVal)
{
	var orderUrl = 'http://www.moredisneyrewards.com/order.asp';
	var statusUrl = 'http://www.moredisneyrewards.com/status.asp';
	var theaterUrl = 'http://www.moredisneyrewards.com/theater.asp';
	var retailerUrl = 'http://www.moredisneyrewards.com/retailer.asp';
	switch(strVal.toLowerCase())
	{
		case 'order':
			return orderUrl;
			break;
		case 'status':
			return statusUrl;
			break;
		case 'theater':
			return theaterUrl;
			break;
		case 'retailer':
			return retailerUrl;
			break;
		default:
			return false;
			break;
	}
}