mw = 11;
idn = 'utility_arrow_';
$(document).ready(function(){
	TextResizeDetector.TARGET_ELEMENT_ID = 'header';
	TextResizeDetector.USER_INIT_FUNC = init; 
	setNewArrow();
});

function init(){
	var iBase = TextResizeDetector.addEventListener(onFontResize,null);
}

function onFontResize(e, args){
	$('dl.utilityNav dd ul li p a').each(function(){
		$(this).find('canvas').remove();
		$(this).find('img').remove();
	});
	setNewArrow();
}

function setNewArrow(){
	var cnt = 0;
	$('dl.utilityNav dd ul li p a').each(function(){
		$(this).attr('id', idn + cnt.toString());
		cnt++;
	});
	var max = cnt;
	for(var i=0; i< max; i++){
		var myh = 0;
		$('#' + idn + i.toString()).parent().each(function(){
			myh = $(this).height();
		});
		if( $.browser.msie ){
			$('#' + idn + i.toString()).each(function(){
				$(this).append('<img src="/assets/images/bg/utilitynavi_arrow.gif" width="' + mw.toString() + '" height="' + myh + '" />');
			});
		}else{
			var el = document.createElement('canvas');
			el.setAttribute('width', mw);
			el.setAttribute('height', myh);
			document.getElementById(idn + i.toString()).appendChild(el);
			var ctx = el.getContext('2d');
			ctx.fillStyle = '#D4D4D4';
			ctx.beginPath();
			ctx.moveTo(0,0);
			ctx.lineTo(4,0)
			ctx.lineTo(mw, Math.floor(myh / 2));
			ctx.lineTo(4,myh);
			ctx.lineTo(0, myh);
			ctx.fill();
		}
	}
}
