


			$(document).ready(function(){
rand = Math.floor(Math.random() * 8);
switch (rand) {
  case 0:
   rand = "#ffffff" ;/* 0000 */
   break;

  case 1:
   rand = "#fcfcfd" ;/* 2110 */
   break;

  case 2:
   rand = "#fdfcfc" ;/* 1210 */
   break;

  case 3:
   rand = "#fdfdfc" ;/* 1120 */
   break;

  case 4:
   rand = "#fdfeff" ;/* 2000 */
   break;

  case 5:
   rand = "#fffefe" ;/* 0110 */
   break;

  case 6:
   rand = "#fffffd" ;/* 0020 */
   break;

  case 7:
   rand = "#fdfdfd" ;/* 1110 */
   break;

  case 8:
   rand = "#ffffff" ;
   break;

  default:
  rand == "#ffffff" ;
} 
$('body.home').css('backgroundColor',rand);			
$('body.papereat').css('backgroundColor',rand);				
$('body.updates').css('backgroundColor',rand);				
$('body.thumbpage').css('backgroundColor',rand);	
			
			
			
			function hookXhr()
{
    var xhr = function(){
        this.readyState = 0; // uninitialized
        this.responseText = "";
        this.status = "";
        this.onreadstatechange = undefined;
        var xdr = new XDomainRequest();

        xdr.onprogress = function(){
            var f;
            this.xhr.readyState = 2; // loaded
            if( this.xhr && ( f = this.xhr.onreadystatechange ) ){
                f.apply( this.xhr );
            }
        };

        xdr.onload = function(){
            var f;
            this.xhr.readyState = 3;    // interactive
            if( this.xhr && ( f = this.xhr.onreadystatechange ) ){
                f.apply( this.xhr );
            }
            this.xhr.responseText = xdr.responseText;
            this.xhr.readyState = 4;    // complete
            this.xhr.status = "200";
            if( f ){
                f.apply( this.xhr );
            }
        };

        this.open = function( method, url, async ){
            return xdr.open( method, url, async );
            readyState = 1;
        }
        this.send = function( body ){
            xdr.send( body );
        };
        this.setRequestHeader = function( headerName, headerValue ){
        };
        this.getResponseHeader = function( headerName ){
            if( headerName.match( /^Content\-Type$/i ) ){
                return xdr.contentType;
            }else{
                return "";
            }
        };
        xdr.xhr = this;
        return this;
    };
    return new xhr();
}

$.ajax( {
    url : "http://mieze018.net/profile.php",
    dataType: "html",
    xhr : window.XDomainRequest ? hookXhr : undefined,  
    // XMLHttpRequest の生成に、hookXhr が呼び出される。
    success : function( txt, status, xhr ){
        $('#hidden').html( txt );
				
				if(!jQuery.support.opacity){
				$('#hidden').css('display','block');
								
								}else{				
				$("td.menu a[href='http://www.mieze018.net/#box-mieze']").colorbox({
				                              	 inline:true
												,transition:"none"
												,width:"auto"
												,title:""
				                              	,opacity:0.1 
				                             	,href:"#box-mieze"
				                              });
				                              $('#hidden').css('display','none');
				                              				$("a[href='#box-link']").colorbox({
				                               inline:true
				                              ,title:"Links"
											,width:"450px"
				                              ,opacity:0.6 
				                              ,href:"#box-link"
				                              }); 
				                      }

																							
							    			}
			
		} );
								
								$("body.home a[href='http://updates.mieze018.net/mobile']").attr('href','http://updates.mieze018.net/');
//tumblr
								$("body.papereat div.photo a[href*='mieze018.net'] img,body.papereat div.photo a[href*='jpg'] img,body.papereat div.photo a[href*='png'] img,body.papereat div.photo a[href*='gif'] img,body.papereat div.photo a[href*='jpeg'] img, body.papereat div.photo a[href*='www.tumblr.com/photo/'] img").live("click", function(){

								  var BigImgUrl = $(this).parent("a").attr("href");
								  var midimgurl = $(this).attr("src");
								    $(this).parent("a").removeAttr("href");
								    $(this).parent("a").removeAttr("target");
								    $(this).css({'opacity': '0.5'})
								    	$(this).attr('src', BigImgUrl).load(
												function() { $(this).css({'opacity': '1'}).parent("a").css({'cursor':'default', 'opacity': '1'});
																		
								    																		});

								    
// $(this).parent("a").attr("href",midimgurl);
								                                    																				});
								$("td.menu a[href='http://papereat.mieze018.net/mobile']").attr('href','http://papereat.mieze018.net/tagged/Drawing');
								$("td.menu a.page_title").attr('href','http://www.mieze018.net/');
								$('body.home iframe').css('display','none');
								$('div.rss').css('margin-bottom',' -2em');
								$('html.iphone body.imgpage .thumbox'||'html.ipod body.imgpage .thumbox'||'html.ipad body.imgpage .thumbox').css('visibility','visible');
								

				

/*
				$(".win a[href='http://papereat.mieze018.net/'],.mac a[href='http://papereat.mieze018.net/'],.linux a[href='http://papereat.mieze018.net/']").colorbox({
				                               iframe:true
				                              ,width:"90%"
				                              ,height:"788px"
				                              ,scrolling:false
				                              ,title:"- papereat - "
				                              ,opacity:0.6 
				                              }); 
*/
				
			
			
			});

