/**
 * sisso.js - 質素なWeb制作のためのJS
 *
 * Copyright (C) KAYAC Inc. | http://www.kayac.com/
 * Dual licensed under the MIT <http://www.opensource.org/licenses/mit-license.php>
 * and GPL <http://www.opensource.org/licenses/gpl-license.php> licenses.
 * Date: 2009-06-16
 * @author kyo_ago <http://tech.kayac.com/archive/iepngfix-library-sisso-js.html>
 * @version 1.1.3
 *
 * thanks from
 *   http://www.isella.com/aod2/js/iepngfix.js
 *   http://jquery.com/
 *   http://kyosuke.jp/portfolio/javascript/yuga.html
 *   http://webtech-walker.com/archive/2008/11/02151611.html
 *   http://code.google.com/p/uupaa-js/source/browse/trunk/src/ieboost.js
 */
/**
 * domready.js
 * 
 * Copyright (c) 2007 Takanori Ishikawa.
 * License: MIT-style license.
 * 
 * MooTools Copyright:
 * copyright (c) 2007 Valerio Proietti, <http://mad4milk.net>
 * http://www.metareal.org/2007/07/10/domready-js-cross-browser-ondomcontentloaded/
 * http://snipplr.com/view/6029/domreadyjs/
 */
;new function(){var e="Sisso";var c=window[e]||{};window[e]=c;if(window[e].is_loaded){return}window[e].is_loaded=true;var a,g=window.jQuery;if(!window.jQuery){f();g=function(){};g.data=function(){};g.removeData=function(){};c.Event=a}var d=document;new function(){var p=d.getElementsByTagName("script");var l=new RegExp(e+"\\.js");var k=p.length;while(k--){if(!l.test(p[k].src.toLowerCase())){continue}var n=p[k].src.split("#");if(n.length===1){return}var o=n.pop().split(/[&;]+/);var h=o.length;while(h--){var m=o[h].split("=");if(c[m[0]]===undefined){c[m[0]]=m[1]}}return}};c.blankUrl=c.blankUrl||"http://tech.kayac.com/data/iepngfix-library-sisso-js/blank.gif";c.rollClass=c.rollClass||"btn";c.rollSetClass=c.rollSetClass||"btnSet";c.externalClass=c.externalClass||"external";c.wordBreakClass=c.wordBreakClass||"wordBreak";c.pngFixSelector=c.pngFixSelector||"img, input, .bgpng";c.pngFixVersion=c.pngFixVersion||"6,7";c.noRoll=c.noRoll||false;c.noRollSet=c.noRoll||false;c.noPngFix=c.noPngFix||false;c.noExternal=c.noExternal||false;c.noBreakAll=c.noBreakAll||false;c.noGMap2Error=c.noGMap2Error||false;c.get_elems=(function(){if(d.getElementsByClassName){return function(h){return d.getElementsByClassName(h)}}if(d.querySelectorAll){return function(h){return d.querySelectorAll("*."+h)}}if(d.evaluate){return function(m){var k=d.evaluate("descendant::*[@class="+m+" or contains(concat(' ', @class, ' '), ' "+m+" ')]",d,null,7,null);var h=[];for(var n=0,j=k.snapshotLength;n<j;h.push(k.snapshotItem(n++))){}return h}}return function(m){var o=new RegExp("(?:^|[ \\n\\r\\t])"+m+"(?:[ \\n\\r\\t]|$)");var k=d.body.getElementsByTagName("*");var h=[];for(var n=0,j=k.length;n<j;++n){var p=k[n];if(p.className.indexOf(m)===-1){continue}if(!o.test(p.className)){continue}h.push(p)}return h}})();c.get_src=function(h){if(h.src){return h.src}src=(h.currentStyle||d.defaultView.getComputedStyle(h,"")).backgroundImage;return(src.match(/^url\((["']?)(.*\.png).*?\1\)/i)||[undefined]).pop()};c.replace_over=function(h){return h.replace(/(?:_o)?(\.\w+)$/,"_o$1")};c.hoverSet=function(m){var p=m.getElementsByTagName("img");var l=p.length;var j={};for(var k=0;k<l;++k){var h=p[k];var o=c.get_src(h);var n=c.replace_over(o);(new Image).src=n;j[o]=n;j[n]=o}c.bind(m,"mouseover",function(){for(var s=0,q=l;s<q;++s){var r=p[s];var t=c.get_src(r);if(j[t]){r.src=j[t]}}});c.bind(m,"mouseout",function(){for(var s=0,q=l;s<q;++s){var r=p[s];var t=c.get_src(r);if(j[t]){r.src=j[t]}}})};c.hover=function(h){var j=c.get_src(h);if(!j){return}j=j.replace(/(?:_o)?(\.\w+)$/,"$1");var i=c.replace_over(j);return h.src?c.add_src_over(h,j,i):c.add_bg_over(h,j,i)};new function(){c.bind=window.jQuery?h:window.addEventListener?j:i;function h(m,k,l){g(m).bind(k+"."+e,l)}function j(m,k,l){m.addEventListener(k,l,false)}function i(m,k,l){m.attachEvent("on"+k,l)}};c.add_over=function(i,l,k,h,j){(new Image).src=k;c.bind(i,"mouseover",h(i));c.bind(i,"mouseout",j(i))};c.add_src_over=function(h,j,i){c.add_over(h,j,i,function(k){return function(){k.src=i}},function(k){return function(){k.src=j}})};c.add_bg_over=function(h,j,i){c.add_over(h,j,i,function(l){var k=l.style;i="url("+i+")";return function(){k.backgroundImage=i}},function(l){var k=l.style;j="url("+j+")";return function(){k.backgroundImage=j}})};c.exec_hover=function(){c.bind(window,"load",function(){var j=c.get_elems(c.rollClass);for(var k=0,h=j.length;k<h;c.hover(j[k++])){}if(c.noRollSet){return}var j=c.get_elems(c.rollSetClass);for(var k=0,h=j.length;k<h;c.hoverSet(j[k++])){}})};c.exec_external=function(){c.bind(window,"load",function(){var j=c.get_elems(c.externalClass);for(var k=0,h=j.length;k<h;j[k++].target="_blank"){}})};c.exec_break_all=function(){var k=navigator.userAgent;var j=k.indexOf(" Gecko/")!==-1&&k.indexOf("; rv:1.8.1")!==-1?"<wbr/>":String.fromCharCode(8203);var i=function(p){var m=p.childNodes;var n=[];var q=0;var r=m.length;while(q<r){n[q]=m[q++]}for(q=0,r=n.length;q<r;++q){var t=n[q];if(t.nodeType===1){if(t.childNodes&&t.childNodes.length){arguments.callee(t)}continue}var o=t.nodeValue;if(!o||/^[ \n\r\t]*$/.test(o)){continue}var l=d.createElement("div");l.innerHTML=o.split("").join(j);var s=t.parentNode;while(l.firstChild){s.insertBefore(l.removeChild(l.firstChild),t)}s.removeChild(t)}};if(k.indexOf("Mozilla/4.0 (compatible; MSIE ")===0&&k.toLowerCase().indexOf("opera")===-1){i=function(l){l.style.wordBreak="break-all"}}var h=function(){var n=c.get_elems(c.wordBreakClass);for(var o=0,m=n.length;o<m;i(n[o++])){}};window.jQuery?g(h):a.domReady.add(h)};if(!c.noExternal){c.exec_external()}if(!c.noBreakAll){c.exec_break_all()}var b=new RegExp("^Mozilla\\/4\\.0 \\(compatible; MSIE (?:5\\.5|["+(c.pngFixVersion.replace(/[^0-9]/g,""))+"]\\.)");if(!b.test(navigator.userAgent)){if(!c.noRoll){c.exec_hover()}return}c.eid="_"+e+"_src";c.store=function(h,i){return i?h[c.eid]=i:h[c.eid]};new function(){var h=c.get_src;c.get_src=function(i){return i[c.eid]||(i[c.eid]=h.call(c,i))}};c.set_size=function(h){var i=h.currentStyle;if(i.width==="auto"&&h.offsetWidth){h.style.width=h.offsetWidth+"px"}if(i.height==="auto"&&h.offsetHeight){h.style.height=h.offsetHeight+"px"}};c.fix=function(h){h.runtimeStyle.behavior="none";var j=h[c.eid]||(h[c.eid]=c.get_src(h));if(!j){j=h.src}if(!j||!/\.png/i.test(j.toLowerCase())){return}c.set_size(h);if(h.src){h.src=c.blankUrl}if(!h.style.zoom&&h.style.zoom!=="0"){h.style.zoom=1}c.swap(h,j);if(!h.src){c.fix_bg_elem(h)}c.bind(h,"propertychange",function(){i.apply(this,arguments)});function i(){var l=window.event;var m=l.srcElement;if(window.jQuery){m=this}var k=i;i=function(){};new function(){if(m.src){if(m.src===c.blankUrl){return}c.swap(m,m.src);m[c.eid]=m.src;m.src=c.blankUrl;return}var n=c.get_src(m);if(!n){return}c.swap(m,n);m.style.backgroundImage="none";m[c.eid]=n};i=k}};c.fix_bg_elem=function(i){i.style.backgroundImage="none";c.set_pos(i);(i.tagName.toUpperCase()==="A")&&(i.style.cursor=i.style.cursor||"pointer");var h=({relative:1,absolute:1})[(i.currentStyle.position||"").toLowerCase()];var j="\n\n<"+i.nodeName+(i.id&&' id="'+i.id)+'">';(function(k){if(!k.length){return}if(h){return alert(e+": Unclickable children"+j)}for(var l=0,o=k.length;l<o;++l){var m=k[l];if(!m.style){continue}if(m.style.position){continue}m.style.position="relative"}})(i.getElementsByTagName("a"))};c.set_pos=function(i){var h=["input","textarea","select"];var j=function(k,o){for(var l=k.length,n;n=k[--l];){var m=n.style;!m.position&&(m.position="relative");if(!o){continue}!m.cursor&&(m.cursor=o)}};while(h.length){j(i.getElementsByTagName(h.pop()))}j(i.getElementsByTagName("a"),"pointer")};c.swap=function(i,l){if(l===c.blankUrl){return}try{var h=(i.currentStyle.backgroundRepeat==="no-repeat")?"crop":"scale";var k="DXImageTransform.Microsoft.AlphaImageLoader";if(i.filters.length&&k in i.filters){i.filters[k].enabled=1;i.filters[k].src=l;return}i.style.filter="progid:"+k+'(src="'+l+'",sizingMethod="'+h+'");'}catch(j){}};c.exec_pngfix=function(){if(window.GMap2&&!c.noGMap2Error){alert(e+" : do not read GMap2")}var h="expression("+e+".fix(this));";var i=d.createElement("div");i.innerHTML=(['div<div><style type="text/css">',c.pngFixSelector+"{ behavior : "+h+" };","</style></div>"]).join("");d.getElementsByTagName("head")[0].appendChild(i.getElementsByTagName("style")[0])};if(!c.noRoll){c.exec_hover()}if(!c.noPngFix){c.exec_pngfix()}function f(){if(typeof a=="undefined"){a=new Object()}a.domReady={add:function(h){if(a.domReady.loaded){return h()}var j=a.domReady.observers;if(!j){j=a.domReady.observers=[]}j[j.length]=h;if(a.domReady.callback){return}a.domReady.callback=function(){if(a.domReady.loaded){return}a.domReady.loaded=true;if(a.domReady.timer){clearInterval(a.domReady.timer);a.domReady.timer=null}var m=a.domReady.observers;for(var p=0,n=m.length;p<n;p++){var o=m[p];m[p]=null;o()}a.domReady.callback=a.domReady.observers=null};var k=!!(window.attachEvent&&!window.opera);var i=navigator.userAgent.indexOf("AppleWebKit/")>-1;if(document.readyState&&i){a.domReady.timer=setInterval(function(){var m=document.readyState;if(m=="loaded"||m=="complete"){a.domReady.callback()}},50)}else{if(document.readyState&&k){var l=(window.location.protocol=="https:")?"://0":"javascript:void(0)";document.write('<script type="text/javascript" defer="defer" src="'+l+"\" onreadystatechange=\"if (this.readyState == 'complete') "+e+'.Event.domReady.callback();"><\/script>')}else{if(window.addEventListener){document.addEventListener("DOMContentLoaded",a.domReady.callback,false);window.addEventListener("load",a.domReady.callback,false)}else{if(window.attachEvent){window.attachEvent("onload",a.domReady.callback)}else{var h=window.onload;window.onload=function(){a.domReady.callback();if(h){h()}}}}}}}}}};