var tmp = navigator.appName == 'Microsoft Internet Explorer' ? 1 : 0;
	if(tmp) var isIE = document.namespaces ? 1 : 0;
	function roundCorner(){
		var bMask =  document.getElementById('b-mask_pos')
		bMaskL = bMask.childNodes.length
		for( i = 0; i < bMaskL; i++ ){
			if( bMask.childNodes[i].nodeType == 1 ){
				child = bMask.childNodes[i]
				image = child.childNodes[0]
				canvas = document.createElement('CANVAS');
				canvas.setAttribute('width', child.offsetWidth);
				canvas.setAttribute('height', child.offsetHeight);
				bMask.childNodes[i].insertBefore(canvas,bMask.childNodes[i].childNodes[0]);
				ctx = canvas.getContext('2d');
				if( child.offsetWidth < 300 ){
					radius = Math.round( ( child.offsetWidth - 10 ) / 2 )
				}
				else{
					radius = Math.round( ( child.offsetWidth - 18 ) / 2 )
				}				
				x = radius + 3
				y = radius + 3
				ctx.arc(x, y, radius, 0, 2*Math.PI, true)
				globalCompositeOperation = "source-in";
				ctx.clip();
				ctx.drawImage(image, 0, 0);
			}
		}
	}
	function roundCornerIE(){
		
		var bMask =  document.getElementById('b-mask_pos')
		bMaskL = bMask.childNodes.length
		for( i = 0; i < bMaskL; i++ ){
			child = bMask.childNodes[i]
			image = child.childNodes[0]
			if( child.offsetWidth < 300 ){
				radius = Math.round( ( child.offsetWidth - 10 ) / 2 )
			}
			else{
				radius = Math.round( ( child.offsetWidth - 15 ) / 2 )
			}
			width = child.offsetWidth
			height = child.offsetHeight
			dx = 1
			x = radius + dx
			y = radius + dx
			vml = document.createElement(['<var style="zoom:1;overflow:hidden;display: block; width:' + width + 'px;height:' + height + 'px;padding:0;">'].join(''))
			var path = "m " + dx + "," + radius; 
			path += " qy " + radius + "," + dx;
			path += " qx " + 2*radius + "," + radius;
			path += " qy " + radius + "," + 2*radius;
			path += " qx 0, " + radius;
			path += " x e";
			data = '<v:shape stroked="f" filled="t" fillcolor="#fff" coordorigin="0,0" coordsize="' + width + ',' + height + '" path="' + path + '" style="zoom:1;padding: 0;display: block; width:' + width + 'px;height:' + height + 'px;"><v:fill src="' + image.src + '" type="tile" alignshape="False"/></v:shape>';
			vml.innerHTML = [data].join('');
			image.insertAdjacentElement('BeforeBegin',vml);
		}
	}
	window.onload = function(){
		if(isIE){roundCornerIE()}
		else{
			roundCorner()
		}
	}	
