/* 101102 */
/*---POUR IN MY STANDARD, UBIQUITOUS FUNCTIONS---*/
function params(wut,qp,dflt){ dflt=(dflt==null)?'':dflt; try{r=unescape(wut.match(new RegExp(qp+"=+([^&;]*)"))[1]);}catch(qp){r=dflt;} return r; }
function addZero(vNumber){ return ((vNumber<10)?"0":"")+vNumber; }
function gid(_id){ return document.getElementById(_id); }
function inner(_gid,_text){ gid(_gid).innerHTML=_text; }
function show(){ for (i=0; i<show.arguments.length; i++){ gid(show.arguments[i]).style.display='block'; }}
function hide(){ for (i=0; i<hide.arguments.length; i++){ gid(hide.arguments[i]).style.display='none'; }}

if (params(location.search,'debug','false')!='true'){ window.onerror=function(){ return true; }; }

try{ _gpn=/([\w-~]*)(\.htm|$|\?|\#|\.cgi)/i.exec(location.href)[1]; } catch(pn){ _gpn='index'; } if (_gpn==""){ _gpn="index"; }

legalFooterColor="#000";
var first_teir_menu_selected; var second_teir_menu_selected; var third_teir_menu_selected;

_base="http://disneyrewards.disney.go.com";

styles=[
[".even","padding:0; margin:3px 3px 3px 18px;"],
[".sup","font:8px/8px verdana; vertical-align:40%;"],
["div.disclaimer","margin:0 auto 0; text-align:left; font:11px/12px Verdana, Arial, Helvetica, sans-serif;"],
["div.disclaimer table","font-size: 11px;"],
["div.disclaimer .number","font-size:8px; width:10px; text-align:right;"]
];
document.writeln('<style id="VISASTYLES">');  for (sty in styles){ document.writeln(styles[sty][0]+'{ '+styles[sty][1]+' }'); }  document.writeln('</style>');


function $flash(ef){ //new $flash({ movie:'', w:'100%', h:'173', bgcolor:'', base:'', vars:'', id:'' }).render();
ef.w=(ef.w==null)?'590':ef.w; ef.h=(ef.h==null)?'450':ef.h; ef.id=(ef.id==null)?'flashmovie':ef.id; ef.wmode=(ef.wmode==null)?'transparent':ef.wmode;
sendback={}
flashstr='<object id="'+ef.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ef.w+'" height="'+ef.h+'"><param name="movie" value="'+ef.movie+((ef.vars!=null)?'?'+ef.vars:'')+'"><param name="quality" value="high"><param name="menu" value="false"><param name="wmode" value="'+ef.wmode+'"><param name="scale" value="noscale"><param name="allowScriptAccess" value="always"><param name="show" value="#ffffff">';
if (ef.base!=null){flashstr+='<param name="base" value="'+ef.base+'">'; }
if (ef.bgcolor!=null){flashstr+='<param name="bgcolor" value="'+ef.bgcolor+'">'; }
if (ef.vars!=null){flashstr+='<param name="flashFars" value="'+ef.vars+'">'; }
flashstr+='<embed name="'+ef.id+'" id="'+ef.id+'" src="'+ef.movie+((ef.vars!=null)?'?'+ef.vars:'')+'" menu="false" quality="high" pluginspage="//www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ef.w+'" height="'+ef.h+'" swLiveConnect="true" wmode="'+ef.wmode+'" scale="noscale" allowScriptAccess="always"';
if (ef.base!=null){flashstr+=' base="'+ef.base+'"'; }
if (ef.bgcolor!=null){flashstr+=' bgcolor="'+ef.bgcolor+'"'; }
if (ef.vars!=null){flashstr+=' FlashVars="'+ef.vars+'"'; }
flashstr+='></embed></object>';
sendback.toString=function(){ return flashstr; }
sendback.render=function(){ document.writeln(flashstr); }
sendback.inner=function(targetgid){ gid(targetgid).innerHTML=flashstr; }
return sendback;
}


function DoFlashDetection(){
if (params(document.cookie,'NO_FLASH_DETECT','false')!='true'){
CreateInterface(); DetectFlash();
}
}

/*---AUTO-EMBED THESE TOO SINCE MOST PAGES WILL NEED CHROME AND FLASH DETECTION---*/
document.writeln('<scr'+'ipt language="javascript" src="//global.go.com/detect/scripts/master_flash_light.js"><\/scr'+'ipt>');


/*---EASY PRINTABLE FUNCTION---*/
function popPrintable(){
filltext=gid('PRINTABLE-AREA').innerHTML.replace(new RegExp("<a +[^>]*>",'gi'),'').replace(/<\/a>/gi,'');
try{ filltext+='<br><br><br>'+gid('disclaimerdiv').innerHTML; }catch(e){}
eve=window.open('','printwindow','width=640, height=600, left=1, top=1, scrollbars=1, resizable=1, statusbar=1, menubar=0, toolbar=0');
eve.document.writeln('<html><head><title>'+document.title+'</title><style>'+gid('VISASTYLES').innerHTML+'\
.noprint{ display:none; }\
.printindent{ padding:0 20 0 48px; }</style>');
eve.document.writeln('</head><body style="margin:0; padding:1px; background:white; font:11px verdana; text-align:center;"><div style="text-align:left; width:592px; margin:0 auto 0 auto;">');
eve.document.writeln('<table cellpadding="0" cellspacing="0" border="0" align="center">\
<tr><td rowspan="3" width="186"><img src="http://disneyrewards.disney.go.com/images/pagetops/printableheaderlogo.gif"></td>\
<td rowspan="3" width="12" valign="bottom" align="right"><img src="http://disneyrewards.disney.go.com/images/pagetops/printableheaderleft.gif"></td>\
<td width="281" height="29" valign="bottom"><img src="http://disneyrewards.disney.go.com/images/pagetops/printableheadertop.gif"></td>\
<td rowspan="3" width="11" valign="bottom"><img src="http://disneyrewards.disney.go.com/images/pagetops/printableheaderright.gif"></td></tr>\
<tr><td height="37" align="right" style="padding-right: 14px;"><img src="http://disneyrewards.disney.go.com/images/pagetitles/newsandoffers.gif"></td></tr>\
<tr><td height="5"><img src="http://disneyrewards.disney.go.com/images/pagetops/printableheaderbottom.gif"></td></tr>\
</table><br><br>');
eve.document.writeln(filltext);
eve.document.writeln('</div></body></html>');
eve.document.close();
}


function GOurl(url){
url=url.replace(/ *$/mg,'').replace(/^ */mg,'');
if (url.indexOf('http')==-1){ url="http://"+url; }
window.open("http://home.disney.go.com/guestservices/disclaimers/redirect?destination="+escape(url));
}
// end link disclaimer


function writeLogo(){
document.writeln('<div id="left_bar"><div id="logo"><a href="'+_base+'/index.html"><img src="'+_base+'/images/template_images/logo.jpg" alt="Disney Rewards Visa Card from Chase" /></a></div></div>');
}

function writeTopMenu(){}


var globalPromoItems=[];
var items=[]; var subfooter='';

function writeFooter()
{

	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" style="vertical-align: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 JPMorgan Chase Bank, N.A. and their 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><br><br>');
	}

	document.writeln('<div class="noprint" style="text-align:center; margin-bottom:20px;"><a href="'+_base+'/footer/contactdisneyrewards.html" class="popupwindow" rel="height:575" name="&lid=footer/contact_disney&lpos=footer/">Contact Disney Rewards</a> | <a href="'+_base+'/footer/sitemap.html" class="popupwindow" name="&lid=footer/footer_sitemap&lpos=footer/">Disney Rewards Site Map</a> | <a href="'+_base+'/footer/sitemaphelp.php" class="popupwindow">Disney Rewards Site Help</a> | <a href="http://disneyrewards.disney.go.com/redirect.php?destination=http://www.mychasecreditcards.com/disney/cm/?CELL=62BH11" rel="height:375" target="_blank" name="&lid=footer/footer_not_a_cardmember&lpos=footer/">Not a Cardmember?</a> | <a href="'+_base+'/footer/registernow.html" class="popupwindow" rel="height:250" name="&lid=footer/footer_register_now&lpos=footer/">Register Now</a></div>');

/*---TRY AUTO-REPLACING ALL LINK DISCLAIMER URLS WITH NEW STYLE---*/
for (a=0; a<document.links.length; a++){
try{ if (document.links[a].href.indexOf("GOurl")!=-1){
url=document.links[a].href.replace(/(javascript:GOurl\('|'\))/gi,"").replace(/ *$/mg,'').replace(/^ */mg,'');
if (url.indexOf('http')==-1){ url="http://"+url; }
document.links[a].href="http://home.disney.go.com/guestservices/disclaimers/redirect?destination="+escape(url);
document.links[a].target="_blank";
}}catch(e){}}

rolloverInit();

}


function AddEvent(obj, evType, fn){ 
if (obj.addEventListener){ obj.addEventListener(evType, fn, false); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } 
}


/*---XML IMPORT/PARSING FUNCTIONS---*/
isSafari=(navigator.appVersion.match(/safari/gi)!=null);
function nval(_wut){ try{
returnValue=((isSafari)?((_wut.childNodes.length>0)?_wut.firstChild.nodeValue:_wut.nodeValue):((navigator.appName=="Netscape")?_wut.textContent:_wut.text)); return (returnValue!=null)?returnValue:''; }catch(nov){ return ''; }}
function gtn(_wut,_tag,index){ rt=_wut.getElementsByTagName(_tag);
return ((rt.length>1)?((index!=null)?nval(rt[index]):rt):((rt.length==0)?'':((index!=null)?rt:nval(rt[0])))); }
function gtn0(_wut,_tag){ tempgtn=gtn(_wut,_tag); if (typeof(tempgtn)=='string'){ tempgtn=gtn(_wut,_tag,0); }  return tempgtn; }
function importXML(xmlobj){
_xmlfile=xmlobj.url; _xmlRtn=xmlobj.obj; _act=xmlobj.action;

if (window.XMLHttpRequest && !(window.ActiveXObject)){
xmlDoc=new XMLHttpRequest(); xmlDoc.onreadystatechange=function(){ if (xmlDoc.readyState==4){ eval(_xmlRtn+"=xmlDoc.responseXML"); eval(_act); }}
xmlDoc.open("GET",_xmlfile,true); xmlDoc.send(null);
} else if (document.implementation && document.implementation.createDocument){
xmlDoc=document.implementation.createDocument("","",null); xmlDoc.onload=function(){ eval(_xmlRtn+"=xmlDoc"); eval(_act); }
xmlDoc.load(_xmlfile);
} else if (window.ActiveXObject){
xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.onreadystatechange=function(){ if (xmlDoc.readyState==4){ eval(_xmlRtn+"=xmlDoc"); eval(_act); }}
xmlDoc.load(_xmlfile);
} else  { return; }
//xmlDoc.load(_xmlfile);

}
function getAtt(_wut,_att){ return _wut.getAttribute(_att); }
function getIndexByAttribute(_wut,_att,_val){ ri=-1; if (_wut.length>0){ for (i=0; i<_wut.length; i++){ if (getAtt(_wut[i],_att)==_val){ ri=i; break; }}} return ri; }
/*---END XML IMPORT/PARSING FUNCTIONS---*/


function Joiterator(joey){
this.items=joey.items; this.count=joey.items.length; this.numshow=joey.numshow; this.currentItem=this.items[0]; this.currentPage=0;
if (this.numshow=="all"){ this.numshow=this.count; }
try{ this.pageCount=Math.floor(joey.items.length/joey.numshow)+1; }catch(j){ this.pageCount=1; }
var jtp=[]; var jtcp=-1;
for (jj=0; jj<this.count; jj++){
if (jj%this.numshow==0 || isNaN(jj%this.numshow)){ jtcp++; jtp[jtp.length]=[]; }
this.items[jj].index=jj; jtp[jtcp][jtp[jtcp].length]=this.items[jj];
}
this.pages=jtp; this.pageCount=this.pages.length;
this.isFirst=function(){ return (this.currentPage==0 || this.count==0); }
this.isLast=function(){ return (this.currentPage==this.pageCount-1 || this.count==0); }
this.next=function(){ if (!this.isLast()){ this.currentPage++; this.currentItem=this.pages[this.currentPage][0]; }}
this.back=function(){ if (!this.isFirst()){ this.currentPage--; this.currentItem=this.pages[this.currentPage][0]; }}
this.setPage=function(_pageToGet){ if (!isNaN(_pageToGet) && _pageToGet>=0 && _pageToGet<this.pageCount){ this.currentPage=_pageToGet; this.currentItem=this.pages[this.currentPage][0]; }}
return this;
}


function rollins(e){
if (window.event) { thislink = window.event.srcElement; } else if (e.target) { thislink = e.target; } else { return; }
for (j=0;j<myArraySet.length;j++){ if (myArraySet[j][0]==thislink.id+'_over'){document.getElementById(thislink.id).src=myArraySet[j][1].src; break;}}}
function unrollins(e){
if (window.event) { thislink = window.event.srcElement; } else if (e.target) { thislink = e.target; } else { return; }
for (k=0;k<myArraySet.length;k++){ if (myArraySet[k][0]==thislink.id){ document.getElementById(thislink.id).src=myArraySet[k][1].src; break;}}}
function rolloverInit(){
myArraySet=new Array(); myImages=new Array(); count=-1;
for (i=0;i<document.links.length;i++){
elk=document.links[i];
if (elk.id!=""){
bob=document.getElementById('i'+elk.id); if (bob!=null){ unName=bob.src; count++;
c3=bob.src.replace(/_off\./gi,'_ovr.').replace(/_on\./gi,'_ovr.').replace(/-off\./gi,'-on.').replace(/_up/gi,'_over');
thisImage=new Image(); thisImage.src=c3; myArraySet[count]=new Array(bob.id+'_over',thisImage);
elk.onmouseover=rollins; count++; thisImage=new Image(); thisImage.src=unName; myArraySet[count]=new Array(bob.id,thisImage);elk.onmouseout=unrollins;
bob.src=c3; bob.src=unName; //FLIP REAL QUICK TO PRELOAD
}}}}


function goSearch(){
if (gid('queryinput').value=="Search DisneyRewards.com"){ gid('queryinput').value="" }

//location.href="http://disneyrewards.disney.go.com/search.html?q="+gid('queryinput').value;
location.href="/search?q="+encodeURIComponent(gid('queryinput').value);


}

function checkClearBox(boxer){ if (boxer.value=="Search DisneyRewards.com"){ boxer.value=""; }}


