function myGetCookie(myCookie){
   myCookie = '@fbLog=';
   myValue = null;
   myStr = document.cookie + ";" ;
   myOfst = myStr.indexOf(myCookie);
   if (myOfst != -1){
      myStart = myOfst + myCookie.length;
      myEnd   = myStr.indexOf(";" , myStart);
      myValue = unescape(myStr.substring(myStart,myEnd));
   }
   return myValue;
}

var log_data = {
	"session": null,
	"getSession": function(){
		if( session = myGetCookie('@fbLog') ){
			this.session = session;
			return session;
		}
		else if(this.session){
			return this.session;
		}
		else{
			if (!navigator.cookieEnabled) {
				this.session = 'no cookie';
				return this.session;
			}
			else{
				myExp = new Date();
				myExp.setTime(myExp.getTime()+(1000*60*60*24*365));
				myItem = '@fbLog=' + escape('3e0c610fb8146bc44cd5255d904cd1b6') + ";";
				myPath = "path=/;";
				myDomain = "domain=" + location.hostname + ";";
				myExpires = "expires="+myExp.toGMTString();
				document.cookie =  myItem + myPath + myDomain + myExpires;
				this.session = '3e0c610fb8146bc44cd5255d904cd1b6';
				return '3e0c610fb8146bc44cd5255d904cd1b6';
			}
		}
	},
	"url"       : location.href ? location.href : '',
	"referer"   : document.referrer ? document.referrer : '',
	"color"     : screen.colorDepth ? screen.colorDepth : '',
	"resolution": screen.width + ' x ' + screen.height,
	"clientSize": function(){
		if(window.innerWidth){
			return window.innerWidth + ' x ' + window.innerHeight;
		}
		else if(document.body.clientWidth){
			return document.body.clientWidth + ' x ' + document.body.clientHeight;
		}
		else if(document.documentElement.clientWidth){
			return document.documentElement.clientWidth + ' x ' + document.documentElement.clientHeight;
		}
		else{
			return '';
		}
	},
	"send" : function(){
		var sendData = '';
		sendData+= '?session='        + encodeURIComponent(this.getSession());
		sendData+= '&amp;url='        + encodeURIComponent(this.url);
		sendData+= '&amp;referer='    + encodeURIComponent(this.referer);
		sendData+= '&amp;color='      + encodeURIComponent(this.color);
		sendData+= '&amp;resolution=' + encodeURIComponent(this.resolution);
		sendData+= '&amp;clientSize=' + encodeURIComponent(this.clientSize());
		sendData+= '&amp;monitor_id=' + encodeURIComponent(0);
		document.write('<img src="http://ssl.fbmanager.jp/log/mitsubishichemicalholdingse/receive/' + sendData + '" width="1" height="1" alt="" style="display:none">');
		var iframes = document.getElementsByTagName('iframe');
		for( var i = 0; i < iframes.length; i++ ){
			//iframes[i].src+= '?session=' + this.getSession();
			var newUrl = iframes[i].src + '?session=' + this.getSession();
			iframes[i].contentWindow.location.replace(newUrl);			
		}
	}
}

log_data.send();
