if(!BP100){
  var BP100={
     $:function (id,tag,parent){
      if(typeof(id)!=typeof(''))return id;
      var node;
      if(node=document.getElementById(id))return node;
      if(!tag)return null;
      node=document.createElement(tag);
      node.setAttribute('id',id);
      if(!parent)parent=document.body;
      parent.appendChild(node);
      return document.getElementById(id);
    }
    ,$element:function (tag,o){
      if(window.attachEvent){
        if(o && o['name']){
          var single={input:1,br:1,hr:1};
          if(tag in single){
            tag='<'+tag+' name="'+o['name']+'" />';
          }else{
            tag='<'+tag+' name="'+o['name']+'"></'+tag+'>';
          }
        }
      }
      var node=document.createElement(tag);
      if(o){
        for(name in o){
          switch(name){
            case 'text':
              var t=document.createTextNode(o[name])
              node.appendChild(t);
              break;
            case 'css':
            case 'style':
              var css=o['style']||o['css']||{};
              var ns=node.style;
              for(cname in css)ns[cname]=css[cname];
              break;
            case 'child':
              var nc=o[name],len=nc.length,i;
              for(i=0;i<len;i++){
                node.appendChild(nc[i]);
              }
              break;
            case 'parent':
              var np=BP100.$(o[name]);
              np.appendChild(node);
              break;
            default:
              var value=o[name];
              if(typeof(value)==typeof(''))node.setAttribute(name,value);
          }
        }
      }
      return node;
    }
    ,$div:function (parent){
      this._divnumber=this._divnumber || 0;
      var dno=++this._divnumber;
      parent=parent||document.body;
      var div=this.$('__div__'+dno,'div',parent);
      var ss=div.style;
      ss.position='absolute';
      ss.border='none';
      ss.width='1px';
      ss.height='1px';
      ss.margin='0 0 0 0';
      ss.padding='0 0 0 0';
      ss.fontSize='12px';
      ss.color='black';
      ss.backgroundColor='transparent';
      return div;
    }
    ,event:{
      watch:function(target,event,func,cap){
        try{
          if(target.addEventListener){
            cap=cap||false;
            target.addEventListener(event,func,cap);
          }else if(target.attachEvent){
            target.attachEvent('on'+event,func);
          }
        }catch(e){}
      }
      ,unwatch:function(target,event,func,cap){
        try{
          if(target.addEventListener){
            cap=cap||false;
            target.removeEventListener(event,func,false);
          }else if(target.attachEvent){
            target.detachEvent('on'+event,func);
          }
        }catch(e){}
      }
      ,element:function (event){
        var el=event.srcElement||event.target;
        return el;
      }
    }
    ,callback:{
      list:{}
      ,compare:function (cb1,cb2){
        /**/
        if(cb1.func!=cb2.func)return false;
        if(cb1.args && cb1.args.length!=cb2.args.length)return false;
        return true;
      }
      ,get:function(event,target,func,args){
        /**/
        var wrappers=BP100.callback.list[event];
        if(!wrappers){
          BP100.callback.list[event]=[];
          return null;
        }
        var wrapper=null;
        /**/
        var len=wrappers.length;
        for(i=0;i<len;i++){
          if(wrappers[i].target==target){
            wrapper=wrappers[i];
            break;
          }
        }
        if(!func)return wrapper;
        if(!wrapper)return null;
        /**/
        var callbacks=wrapper.list;
        var callback;
        var len=callbacks.length;
        for(i=0;i<len;i++){
          callback=callbacks[i];
          if(BP100.callback.compare(callback,{func:func,args:args})){
            return callback;
          }
        }
        return null;
      }
      ,add:function (target,event,func){
        target=target||window;
        target=BP100.$(target);
        /**/
        var args=[];
        for(i=3;i<arguments.length;i++)args.push(arguments[i]);
        /**/
        var callback=this.get(event,target,func,args);
        if(callback)return;
        /**/
        var wrapper=this.get(event,target);
        if(!wrapper){
          var callbackList=function (){
            var wrapper=BP100.callback.get(event,target);
            var callbacks=wrapper.list,callback;
            for(i in callbacks){
              callback=callbacks[i];
              if(callback.func)callback.func.apply(this,callback.args);
            }
          }
          wrapper={target:target,list:[],callbackList:callbackList};
          this.list[event].push(wrapper);
          if(event=='repeat'){
          }else{
            BP100.event.watch(target,event,callbackList);
          }
        }
        wrapper.list.push({func:func,args:args});
      }
      ,del:function (target,event,func){
        target=target||window;
        target=BP100.$(target);
        var args=[];
        for(i=3;i<arguments.length;i++)args.push(arguments[i]);
        var wrapper=this.get(event,target);
        if(!wrapper)return false;
        var callbacks=wrapper.list,callback;
        /**/
        var newCallbacks=[];
        for(i in callbacks){
          callback=callbacks[i];
          if(BP100.callback.compare(callback,{func:func,args:args}))continue;
          newCallbacks.push(callback);
        }
        if(newCallbacks.length){
          wrapper.list=newCallbacks;
          return;         }
        /**/
        var wrappers=BP100.callback.list[event];
        var newWrappers=[];
        var wrapper=null;
        var callbackList=null;
        for(i in wrappers){
          wrapper=wrappers[i];
          if(wrapper.target==target){
            callbackList=wrapper.callbackList;
            continue;
          }
          newWrappers.push(wrapper);
        }
        BP100.callback.list[event]=newWrappers;
        BP100.event.unwatch(target,event,callbackList);
      }
    }
    ,maximize:function(div,margin){
      margin=margin||0;
      var psw=window.scrollMaxX || 0
         ,psh=window.scrollMaxY || 0; 
      var ws=this.getWindowSize();
      var ss=this.getScrollSize();
      var style=div.style;
      var width=ws.width,height=ws.height;
      /**/
      if(ss.width <= ws.width && psw && psw < 20)width-=psw;
      if(ss.height <= ws.height && psh && psh < 20)height-=psh;
      style.width=(width-margin)+'px';
      style.height=(height-margin)+'px';
    }
    ,getWindowSize:function(win,doc){
      win=win||window;
      doc=doc||document;
      var ww=doc.documentElement.clientWidth || win.innerWidth || doc.body.clientWidth || 0
         ,wh=doc.documentElement.clientHeight || win.innerHeight || doc.body.clientHeight || 0;
      if(wh > 2000)wh=win.innerHeight || doc.body.clientHeight || 0;
      return {width:ww,height:wh}
    }
    ,getScrollSize:function(){
      var ww=document.documentElement.scrollWidth || document.body.scrollWidth || 0
         ,wh=document.documentElement.scrollHeight || document.body.scrollHeight || 0;
      return {width:ww,height:wh}
    }
    ,getWindowPosition:function(){
      var wx=document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft || 0
         ,wy=document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop || 0;
      return {x:wx,y:wy}
    }
    ,getObjectSize:function(obj){
      var ow=obj.offsetWidth || 0
         ,oh=obj.offsetHeight || 0
      return {width:ow,height:oh}
    }
    ,regist:function (name,obj){
      BP100[name]=obj;
    }
  }
}
BP100.regist('cookie',{
  set:function(name,value,min,path){
    min=min||0;
    var msec=min*60000;
    path=path||'/';
    BP100.cookie._set(name,value,msec,path);
  }
 ,_set:function(name,value,msec,path){
    if(msec){
      var d=new Date();
      d.setTime(d.getTime()+msec);
      var expiry='; expires='+d.toGMTString();
    }else{
      var expiry='';
    }
    path=path||'/';
    document.cookie=name+"="+encodeURIComponent(value)+expiry+"; path="+path;
  }
  ,get:function(name){
    var ne = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++){
      var c=ca[i];
      while(c.charAt(0)==' ')
        c = c.substring(1,c.length);
      if(c.indexOf(ne)==0)
        return decodeURIComponent(c.substring(ne.length,c.length));
    }
    return null;
  }
  ,unset:function(name,path){
    path=path||'/';
    BP100.cookie._set(name,'',-3600,path);
  }
});
BP100.regist('mostTop',function (style){
  if(BP100._mostTopIndex){
    BP100._mostTopIndex;
  }else{
    BP100._mostTopIndex=0;
    var els=document.getElementsByTagName('*'),len=els.length;
    for(var i=0;i<len;i++){
      var el=els[i];
      var zIndex=el.style.zIndex;
      if(!zIndex) {
        var css=el.currentStyle||document.defaultView.getComputedStyle(el,null);
        zIndex = css ? css.zIndex : 0;
      }
      zIndex -= 0;
      if(BP100._mostTopIndex < zIndex)BP100._mostTopIndex=zIndex;
    }
  }
  BP100._mostTopIndex++;
  style.zIndex=BP100._mostTopIndex;
});
BP100.regist('shield',{
   node:null
  ,style:{
    position:'absolute'
    ,display:'none'
    ,backgroundColor:'#dddddd'
    ,opacity:'0.4'
    ,filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=40)'
  }
  ,open:function (){
    if(!this.node)this.node=BP100.$('_pshield_div_','div');
    var div=this.node,style=div.style;
    for(var name in this.style){
      style[name]=this.style[name];
    }
    var w=BP100.getWindowSize();
    style.position='absolute';
    style.left='0px';
    style.top='0px';
    style.width=w.width+'px';
    style.height=w.height+'px';
    BP100.mostTop(style);
    style.display='block';
    BP100.callback.add(null,'scroll',this.resize);
    BP100.callback.add(null,'resize',this.resize);
    BP100.callback.add(div,'mousedown',this.close);
    this.resize();
  }
  ,close:function (){
    var style=BP100.shield.node.style;
    style.width='1px';
    style.height='1px';
    style.left='0px';
    style.top='0px';
    style.display='none';
    BP100.callback.del(null,'scroll',this.resize);
    BP100.callback.del(null,'resize',this.resize);
    BP100.callback.del(this.node,'mousedown',this.close);
  }
  ,resize:function(){
    var div=BP100.shield.node,style=div.style
      ,ws=BP100.getWindowSize()
      ,wp=BP100.getWindowPosition();
    style.left=wp.x+'px';
    style.top=wp.y+'px';
    BP100.maximize(div);
  }
  ,setStyle:function (name,value){
    var shield=BP100.shield;
    if(name=='opacity'){
      if(value < 1){var v1=value*100;var v2=value;}else{var v1=value;var v2=Math.round(value/10)/10;}
      shield.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+v1+')'
      shield.style.opacity=v2;
    }else{
      shield.style[name]=value;
    }
  }
});
BP100.regist('popup',{
   popupNodes:[]
  ,set:function (name,nodeOption,barOption,barCaption,buttons){
    var popup=null,node=null,nopt=null,bopt=null,btns=null,i,len;
    /**/
    if(this.popupNodes[name]){
      popup=this.popupNodes[name];
      node=popup.node || null;
      nopt=popup.nodeOption || {}; 
      bopt=popup.barOption || {}; 
      btns=popup.buttons || [];
    }
    /**/
    if(nodeOption){
      if(!nopt)nopt={};
      for(i in nodeOption)nopt[i]=nodeOption[i];
    }
    if(barOption){
      if(!bopt)bopt={};
      for(i in barOption)bopt[i]=barOption[i];
    }
    if(buttons && !btns){
      btns=[];
      var len=buttons.length;
      for(i=0;i<len;i++)btns[i]=buttons[i];
    }
    /**/
    var bar,main;
    if(!node){
      node=BP100.$div();
      bar=BP100.$div(node);
      if(barCaption){
        bar.innerHTML=barCaption;
      }
      main=BP100.$div(node);
      if(len=btns.length){
        var btn;
        for(i=0;i<len;i++){
          btn=btns[i];
          if(!btn.node)continue;
          bar.appendChild(btn.node);
        }
      }
    }else{
      bar=popup.bar;
      main=popup.main;
    }
    /**/
    var ww=nopt.width||100,hh=nopt.height||100
       ,bw=ww,bh=bopt.height||20
       ,left=nopt.left||0,top=nopt.top||0;
    var ss;
    ss=node.style;
    ss.display='none';
    ss.backgroundColor=nopt.backgroundColor || '#333333';
    ss.width=(ww+2)+'px';
    ss.height=(hh+bh+2)+'px';
    BP100.mostTop(ss);
    ss.left=left+'px';
    ss.top=top+'px';
    ss=bar.style;
    ss.left='1px';
    ss.top='1px';
    ss.height=bh+'px';
    ss.width=ww+'px';
    for(i in bopt){
      ss[i]=bopt[i];
    }
    ss.backgroundColor=bopt.backgroundColor || '#333399';
    if(btns && (len=btns.length)){
      var btn,size;
      for(i=len-1;i>=0;i--){
        btn=btns[i];
        if(!btn.node)continue;
        ss=btn.node.style;
        ss.cursor='pointer';
        ss.position='absolute';
        ss.top=(btn.top||1)+'px';
        if(btn.left){
          ss.left=(btn.left||1)+'px';
        }else if(btn.right){
          ss.right=(btn.right||1)+'px';
        }
        if(btn.func){
          BP100.callback.add(btn.node,'mousedown',btn.func);
        }
      }
    }
    ss=main.style;
    ss.height=(hh)+'px';
    ss.width=(ww)+'px';
    ss.left='1px';
    ss.top=(bh+1)+'px';
    ss.margin='0px';
    ss.padding='0px';
    ss.border='0px';
    ss.backgroundColor='#ffffff';
    this.popupNodes[name]={node:node,nodeOption:nopt,barOption:bopt,main:main,bar:bar};
  }
 ,getMain:function(name){
   var popup=this.popupNodes[name] || null;
   /*if(popup)popup.main.appendChild(div);*/
   return popup?popup.main:null;
 }
 ,getBase:function(name){
   var popup=this.popupNodes[name] || null;
   return popup?popup.node:null;
 }
 ,show:function(name){
   var popup=this.popupNodes[name] || null;
   if(popup){
      popup.node.style.display='block';
      BP100.mostTop(popup.node.style);
   }
 }
 ,hide:function(name){
   var popup=this.popupNodes[name] || null;
   if(popup){
     popup.node.style.display='none';
   }
 }
 ,hideAll:function(){
   for(name in this.popupNodes){
    try{
      this.popupNodes[name].node.style.display='none';
    }catch(e){}
   }
 }
});
/* utf.js - UTF-8 <=> UTF-16 convertion
 *
 * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
 * Version: 1.0
 * LastModified: Dec 25 1999
 * This library is free.  You can redistribute it and/or modify it.
 */

/*
 * Interfaces:
 * utf8 = utf16to8(utf16);
 * utf16 = utf16to8(utf8);
 */

function utf16to8(str) {
    var out, i, len, c;

    out = "";
    len = str.length;
    for(i = 0; i < len; i++) {
	c = str.charCodeAt(i);
	if ((c >= 0x0001) && (c <= 0x007F)) {
	    out += str.charAt(i);
	} else if (c > 0x07FF) {
	    out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
	    out += String.fromCharCode(0x80 | ((c >>  6) & 0x3F));
	    out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
	} else {
	    out += String.fromCharCode(0xC0 | ((c >>  6) & 0x1F));
	    out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
	}
    }
    return out;
}

function utf8to16(str) {
    var out, i, len, c;
    var char2, char3;

    out = "";
    len = str.length;
    i = 0;
    while(i < len) {
	c = str.charCodeAt(i++);
	switch(c >> 4)
	{ 
	  case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
	    // 0xxxxxxx
	    out += str.charAt(i-1);
	    break;
	  case 12: case 13:
	    // 110x xxxx   10xx xxxx
	    char2 = str.charCodeAt(i++);
	    out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));
	    break;
	  case 14:
	    // 1110 xxxx  10xx xxxx  10xx xxxx
	    char2 = str.charCodeAt(i++);
	    char3 = str.charCodeAt(i++);
	    out += String.fromCharCode(((c & 0x0F) << 12) |
					   ((char2 & 0x3F) << 6) |
					   ((char3 & 0x3F) << 0));
	    break;
	}
    }

    return out;
}
/* Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
 * Version: 1.0
 * LastModified: Dec 25 1999
 * This library is free.  You can redistribute it and/or modify it.
 */

/*
 * Interfaces:
 * b64 = base64encode(data);
 * data = base64decode(b64);
 */


var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var base64DecodeChars = new Array(
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
    52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
    -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
    15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
    -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
    41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);

function base64encode(str) {
    var out, i, len;
    var c1, c2, c3;

    len = str.length;
    i = 0;
    out = "";
    while(i < len) {
	c1 = str.charCodeAt(i++) & 0xff;
	if(i == len)
	{
	    out += base64EncodeChars.charAt(c1 >> 2);
	    out += base64EncodeChars.charAt((c1 & 0x3) << 4);
	    out += "==";
	    break;
	}
	c2 = str.charCodeAt(i++);
	if(i == len)
	{
	    out += base64EncodeChars.charAt(c1 >> 2);
	    out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
	    out += base64EncodeChars.charAt((c2 & 0xF) << 2);
	    out += "=";
	    break;
	}
	c3 = str.charCodeAt(i++);
	out += base64EncodeChars.charAt(c1 >> 2);
	out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
	out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6));
	out += base64EncodeChars.charAt(c3 & 0x3F);
    }
    return out;
}

function base64decode(str) {
    var c1, c2, c3, c4;
    var i, len, out;

    len = str.length;
    i = 0;
    out = "";
    while(i < len) {
	/* c1 */
	do {
	    c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
	} while(i < len && c1 == -1);
	if(c1 == -1)
	    break;

	/* c2 */
	do {
	    c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
	} while(i < len && c2 == -1);
	if(c2 == -1)
	    break;

	out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));

	/* c3 */
	do {
	    c3 = str.charCodeAt(i++) & 0xff;
	    if(c3 == 61)
		return out;
	    c3 = base64DecodeChars[c3];
	} while(i < len && c3 == -1);
	if(c3 == -1)
	    break;

	out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));

	/* c4 */
	do {
	    c4 = str.charCodeAt(i++) & 0xff;
	    if(c4 == 61)
		return out;
	    c4 = base64DecodeChars[c4];
	} while(i < len && c4 == -1);
	if(c4 == -1)
	    break;
	out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
    }
    return out;
}

/*vars_begin*/
BP100.regist('vars',{"ctype":"UTF-8","encode":"UTF-8","current_serial":"1276","myblog":false,"remain":74085,"voted_serial":0,"query_base":"7fdf5154cb7e534fe09f9bc72e3e1b205e0723731276066694377b6686234be5537e470ae5ce0","listbutton":"","ww":620,"hh":340,"bh":20,"ah":50,"rsize":137});
/*vars_end*/
BP100.vars.colors={"POPUPBAR":"#eeeeee","POPUPBAR_BG":"#333399","SHIELD_BG":"#dddddd","SHIELD_OPACITY":40,"LEFT_BG":"#eeeeee","LEFT_IMAGE":"url(http:\/\/blog-parts.wmag.net\/okitegami\/images\/footmark.gif)","LEFT_REPEAT":"no-repeat","LEFT_POSITION":"50% 50%"};
BP100.regist('openListWin2',function (ser){
  listWin2=window.open("","listWin2");
  var doc=listWin2.documentElement||listWin2.document;
  doc.open();
  doc.write(
     '<'+'?xml version="1.0" encoding="'+BP100.vars.ctype+'" ?'+'>'
    +'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'
    +' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
    +'<html xmlns="http://www.w3.org/1999/xhtml" lang="ja-JP" xml:lang="ja-JP" dir="ltr">'
    +'<head>'
    +'<title>訪問先一覧 －料理の小部屋－</title>'
    +'<meta http-equiv="content-type" content="text/html; charset='+BP100.vars.ctype+'" />'
    +'<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />'
    +"<link rel='stylesheet' type='text/css' href='http://blog-parts.wmag.net/okitegami/bookmark.css.php' />"
    +"<script type='text/javascript' charset='"+BP100.vars.ctype+"' src='http://blog-parts.wmag.net/okitegami/bookmark.php?ser="+BP100.vars.current_serial+"&enc="+BP100.vars.encode+"'></script>"
    +"</head>"
    +"<body></body>"
    +"</html>"
  );
  doc.close();
});
BP100.regist('openPuchipuchiClient',function (){
  window.open('http://blog-parts.wmag.net/okitegami/base.php?ser=1276&key=');
});

BP100.regist('okitegami_popup',function (){
    var ww=BP100.vars.ww,hh=BP100.vars.hh,bh=BP100.vars.bh;
  var ah=BP100.vars.ah;
  var rw=BP100.vars.rsize,rh=BP100.vars.rsize*3;
    var ws=BP100.getWindowSize()
     ,wp=BP100.getWindowPosition();
  var oleft=0,otop=0;
    var close=BP100.$('puchipuchi_close_gif');
  var client=BP100.$('puchipuchi_client_gif');
  var list2=BP100.$('puchipuchi_list_gif2');
  BP100.popup.set(
    'puchipuchi_iframe'
    ,{left:oleft=((ws.width-ww-rw)/2+wp.x),top:otop=((ws.height-hh-ah)/3+wp.y),width:ww,height:hh}
    ,{backgroundColor:BP100.vars.colors.POPUPBAR_BG,height:bh,textAlign:'left',color:BP100.vars.colors.POPUPBAR,fontSize:'13px'}
    ,'<div style="position:absolute;left:5px;top:2px">'+document.title+'</div>'
    ,(BP100.vars.myblog
      ?[{node:close,right:1,top:1},{node:client,right:18,top:1},{node:list2,right:83,top:1}]
      :[{node:close,right:1,top:1},{node:client,right:18,top:1}]
    )
  );
  BP100.popup.show('puchipuchi_iframe');
  BP100.aframe=BP100.$('puchipuchi_aframe','iframe');
  BP100.aframe.setAttribute('frameborder','0');
  BP100.aframe.setAttribute(
    'src'
   ,'http://blog-parts.wmag.net/okitegami/ad.php?u=http%3A%2F%2Fhappy-cooking.cocolog-nifty.com%2Fblog%2F&e=UTF-8'
  );
  var style=BP100.aframe.style;
  style.position='absolute';
  style.top=(otop+hh+bh+3)+'px';
  style.left=oleft+'px';
  style.width=(ww+2)+'px';
  style.height=ah+'px';
  style.padding='0px';
  style.margin='0px';
  style.display='block';
  style.border='0px';
  BP100.mostTop(style);
  BP100.rframe=BP100.$('puchipuchi_rframe','iframe');
  BP100.rframe.setAttribute('frameborder','0');
  BP100.rframe.setAttribute(
    'src'
   ,'http://blog-parts.wmag.net/okitegami/right.php?u=http%3A%2F%2Fhappy-cooking.cocolog-nifty.com%2Fblog%2F&e=UTF-8'
  );
  var style=BP100.rframe.style;
  style.position='absolute';
  style.top=otop+'px';
  style.left=(oleft+ww+3)+'px';
  style.width=rw+'px';
  style.height=rh+'px';
  style.padding='0px';
  style.margin='0px';
  style.backgroundColor='white';
  style.display='block'
  BP100.mostTop(style);
});

BP100.regist('popdown',function (){
  BP100.callback.del(BP100.$('puchipuchi_iframe'),'load',BP100.iframeload);
  BP100.callback.del(window,'resize',BP100.pmove);
  BP100.callback.del(window,'scroll',BP100.pmove);
  BP100.popup.hideAll();
  BP100.shield.close();
  if(BP100.aframe)BP100.aframe.style.display='none';
  if(BP100.rframe)BP100.rframe.style.display='none';
});

BP100.regist('pmove',function (){
  var ws=BP100.getWindowSize()
     ,wp=BP100.getWindowPosition();
  var main=BP100.popup.getBase('puchipuchi_iframe');
  var ww=BP100.vars.ww,hh=BP100.vars.hh,bh=BP100.vars.bh;
  var ah=BP100.vars.ah;
  var rw=BP100.vars.rsize,rh=BP100.vars.rsize*3;
  if(main){
    var oleft,otop;
    var style=main.style;
    style.left=(oleft=(ws.width-ww-rw)/2+wp.x)+'px';
    style.top=(otop=(ws.height-hh-ah)/3+wp.y)+'px';
    style.display='block';
    BP100.mostTop(style);
  }
  if(BP100.aframe){
    var style=BP100.aframe.style;
    style.position='absolute';
    style.top=(otop+hh+bh+3)+'px';
    style.left=oleft+'px';
    style.width=(ww+2)+'px';
    style.height=ah+'px';
    style.padding='0px';
    style.margin='0px';
    style.display='block'
    style.border='0px';
    BP100.mostTop(style);
  }
  if(BP100.rframe){
    var style=BP100.rframe.style;
    style.position='absolute';
    style.top=otop+'px';
    style.left=(oleft+ww+3)+'px';
    style.width=rw+'px';
    style.height=rh+'px';
    style.padding='0px';
    style.margin='0px';
    style.display='block'
    BP100.mostTop(style);
  }
});


BP100.regist('iframeload',function (){
  var iframe=BP100.$('puchipuchi_iframe');
  var style=iframe.style;
  var ww=BP100.vars.ww,hh=BP100.vars.hh;
  style.width=ww+'px';
  style.height=hh+'px';
  return true;
});

BP100.regist('_vote',function (){
    var shield=BP100.shield;
  shield.setStyle('opacity',BP100.vars.colors.SHIELD_OPACITY);
  shield.setStyle('backgroundColor',BP100.vars.colors.SHIELD_BG);
  shield.open();
    var close=BP100.$('puchipuchi_close_gif','img');
  close.setAttribute('src','http://blog-parts.wmag.net/okitegami/images/close2.gif');
    var client=BP100.$('puchipuchi_client_gif','img');
  client.setAttribute('src','http://blog-parts.wmag.net/okitegami/images/client.gif');
    if(BP100.vars.myblog){
    var list2=BP100.$('puchipuchi_list_gif2','img');
    list2.setAttribute('src','http://blog-parts.wmag.net/okitegami/images/list2.gif');
  }
    var ww=BP100.vars.ww,hh=BP100.vars.hh,bh=BP100.vars.bh;
  var ah=BP100.vars.ah;
  var rw=BP100.vars.rsize,rh=BP100.vars.rsize*3;
  BP100.okitegami_popup();
    var iframe=BP100.$('puchipuchi_iframe','iframe',BP100.popup.getMain('puchipuchi_iframe'));
  iframe.setAttribute('frameborder','0');
  iframe.setAttribute(
    'src'
   ,'http://blog-parts.wmag.net/okitegami/puchipuchi_frame.php?data='+BP100.puchipuchiGetData()+BP100.vars.listbutton+'&r='+Math.floor(Math.random()*10000)
  );
    var style=iframe.style;
  style.width=ww+'px';
  style.height=hh+'px';
  style.padding='0px';
  style.margin='0px';
  if(!BP100.puchipuchi_init){
    BP100.callback.add(iframe,'load',BP100.iframeload);
    BP100.callback.add(BP100.shield.node,'mousedown',BP100.popdown);
    BP100.callback.add(close,'mousedown',BP100.popdown);
    if(BP100.vars.myblog){
      BP100.callback.add(list2,'mouseup',BP100.openListWin2);
      BP100.callback.add(list2,'mouseup',BP100.popdown);
    }
    BP100.callback.add(client,'mouseup',BP100.openPuchipuchiClient);
    BP100.callback.add(client,'mouseup',BP100.popdown);
    BP100.puchipuchi_init=true;
  }
  BP100.callback.add(window,'resize',BP100.pmove);
  BP100.callback.add(window,'scroll',BP100.pmove);
});
function puchipuchiVote(){
  BP100._vote();
}
BP100.regist('banners',[]);
BP100.regist('localsec',Math.round((new Date()).getTime()/1000));
function puchipuchi_set(num){
    /*
  BP100.setPuchipuchiBannersFromCookie();
  */
    /*
  while(BP100.banners.length < num)BP100.banners[BP100.banners.length]='0';
  BP100.banners[num-1]='1';
  var new_status=BP100.banners.join('');
  */
    /*
  BP100.puchipuchi_save_cookie('puchipuchi_status',new_status);
  */
}
BP100.regist('puchipuchi_save_cookie',function (name,value){
  var ldiff=Math.round((new Date()).getTime()/1000)-BP100.localsec;
  var remain=eval(BP100.vars.remain)-ldiff;
  BP100.cookie._set(name,value,remain*1000,'/blog/');
});
BP100.regist('setPuchipuchiBannersFromCookie',function (){
  if(BP100.cookie.get('last_voted_serial')!=BP100.vars.voted_serial){
    BP100.puchipuchi_save_cookie('last_voted_serial',BP100.vars.voted_serial);
    BP100.puchipuchi_save_cookie('puchipuchi_status','');
    BP100.banners=[];
    }else{
    var co=BP100.cookie.get('puchipuchi_status');
      if(co){
      for(var i=0;i<co.length;i++){
        var c=co.charAt(i);
        if(c=='1'){
          BP100.banners[i]=c;
        }else{
          if(BP100.banners.length <= i)BP100.banners[i]='0';
        }
      }
    }
  }
});
BP100.regist('puchipuchiGetData',function (){
  var uri,status;
  try{uri=document.URL;}catch(e){uri='error';}
  BP100.setPuchipuchiBannersFromCookie();
  status=BP100.banners.join('');
  return encodeURIComponent(
    base64encode(
      utf16to8(BP100.vars.query_base+','+uri+','+status)
    )
  );
});
