var IFLoader = (IFLoader) ? IFLoader : { IMAGE_MASK: 'mask.png', IMAGE_TUMAMI: 'tumami.png', resizableElements: [], asResizable: function(ele, min_w, min_h, max_w, max_h) { var cap = (IFLoader.isIe()) ? document.getElementsByTagName('body')[0] : window; var parent = ele.offsetParent; IFLoader.asUnselectable(ele); ele.mask = parent.appendChild(document.createElement('div')); ele.mask.style.position = 'absolute'; ele.mask.style.left = ele.offsetLeft; ele.mask.style.top = ele.offsetTop; ele.mask.display = 'none'; IFLoader.asUnselectable(ele.mask); IFLoader.setBackgroundImage(ele.mask, IFLoader.IMAGE_MASK, true); ele.holder = parent.appendChild(document.createElement('div')); ele.holder.style.position = 'absolute'; ele.holder.style.width = '16px'; ele.holder.style.height = '16px'; ele.holder.style.left = (ele.offsetLeft + ele.offsetWidth - ele.holder.offsetWidth) + 'px'; ele.holder.style.top = (ele.offsetTop + ele.offsetHeight - ele.holder.offsetHeight) + 'px'; IFLoader.asUnselectable(ele.holder); IFLoader.setBackgroundImage(ele.holder, IFLoader.IMAGE_TUMAMI, true); IFLoader.addListener(cap, 'mousedown', function (e) { var target = (e.srcElement) ? e.srcElement : e.target; if (target == ele.holder) { ele.eventW = ele.offsetWidth; ele.eventH = ele.offsetHeight; ele.eventX = e.clientX; ele.eventY = e.clientY; ele.mask.style.display = 'block'; ele.eventFlag = true; return false;}
}, true); IFLoader.addListener(cap, 'mousemove', function (e) { if (ele.eventFlag) { var w = e.clientX - ele.eventX; var h = e.clientY - ele.eventY; ele.resize(ele.eventW + w, ele.eventH + h); return false;}
}, true); IFLoader.addListener(cap, 'mouseup', function (e) { if (ele.eventFlag) { ele.mask.style.display = 'none'; ele.eventFlag = false;}
}, true); IFLoader.addListener(cap, 'resize', function (e) { ele.update();}, true); ele.resize = function(width, height) { width = (min_w && width < min_w) ? min_w : (!min_w && width < 128) ? 128 :
(max_w && width > max_w) ? max_w : (!max_w && width > 2048) ? 2048 : width; height = (min_h && height < min_h) ? min_h : (!min_h && height < 128) ? 128 :
(max_h && height > max_h) ? max_h : height; this.style.width = width + 'px'; this.style.height = height + 'px'; this.mask.style.left = this.offsetLeft; this.mask.style.top = this.offsetTop; this.mask.style.width = width + 'px'; this.mask.style.height = height + 'px'; for (var i in IFLoader.resizableElements) { if (IFLoader.resizableElements[i] && IFLoader.resizableElements[i].update) { IFLoader.resizableElements[i].update();}
}
}; ele.update = function() { this.holder.style.left = (this.offsetLeft + this.offsetWidth - this.holder.offsetWidth) + 'px'; this.holder.style.top = (this.offsetTop + this.offsetHeight - this.holder.offsetHeight) + 'px';}; IFLoader.resizableElements.push(ele);}, asUnselectable: function(ele) { ele.setAttribute('unselectable', 'on'); var style_txt = ele.getAttribute('style'); ele.setAttribute('style', '-moz-user-select:none; -khtml-user-select:none; -webkit-user-select:none; user-select:none;' + style_txt); IFLoader.addListener(ele, 'selectstart', function (e) { return false;});}, setBackgroundImage: function(ele, img_url, flag) { if (flag && IFLoader.isIe()) { ele.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img_url + "', sizingMethod='scale')";} else { ele.style.backgroundImage = (img_url) ? 'url(' + img_url + ')' : '';}
}, addListener: function(elm, type, func, cap) { try { elm.addEventListener(type, func, cap); return true;} catch(e1) {}
try { elm.attachEvent('on' + type, func); return true;} catch(e2) {}
return false;}, isIe: function() { return (window.attachEvent && !window.opera);}, getArgs: function() { var index = location.href.indexOf('?'); return (index > 0) ? location.href.substr(index) : '';}
};
var args = (window.ccsCharacter1) ? '?ccschar=' + window.ccsCharacter1 : IFLoader.getArgs();
document.write('<iframe src="http://chocotto.chew.jp/ccs/' + args + '" style="width:512px; height:454px;" scrolling="no" border="0" frameborder="0"></iframe>'); 