/*--

	Live!Ads fashion walker
	
============================================================================== */
if(navigator.platform.indexOf("Win") < 0 && navigator.appName.indexOf("Internet") >= 0){//Mac IE
}else{
	var _LA_ ={};
	_LA_.url = 'http://labs.accesstrade.net/atgdg/ranking/laGadget?';
	var _Liveads_Src = _LA_.url;
	
	var width = '';
	var height = '';

	
	for(var i in _LiveAds_Ec_Data_){
		if( i != 'ATcid' ){
			_Liveads_Src += i + '=' + _LiveAds_Ec_Data_[i] + '&';
		}
		// size
		if( i == 'cid' ){
			switch( _LiveAds_Ec_Data_[i] ){
			case '01':
				width = '160';
				height = '600';
				break;
			case '02':
				width = '160';
				height = '600';
				break;
			case '03':
				width = '300';
				height = '250';
				break;
			case '04':
				width = '250';
				height = '250';
				break;
			default :
				break;
			}
		}
	}
	//rand
	if(_LiveAds_Ec_Data_.ATcid){
		r_Array = _LiveAds_Ec_Data_.ATcid.split(",");
		var num = Math.floor(Math.random() * r_Array.length);
		_Liveads_Src += 'ATcid='+ r_Array[num];
	}

	var _LA_Cookie = { //cookie
		read:function(CookieName){
			if(document.cookie){
				var cookie_Data = document.cookie;
				var Name =cookie_Data.indexOf(CookieName + "=",0);
				if(Name >= 0){
					var Data = cookie_Data.indexOf(";",Name + CookieName.length + 1);
					Data >= 0? Data = cookie_Data.substring(Name + CookieName.length + 1,Data): Data = cookie_Data.substring(Name + CookieName.length + 1,cookie_Data.length);
					return(Data);
				}
			}
			return(false);
		},
		set:function(CookieName,Value){
			var time =new Date();
			time.setTime(time.getTime() + (1000*60*60*12));
			var exptime =";expires=" + time.toGMTString();
			document.cookie = CookieName + "=" + Value + exptime + "; path=/";
		}
	};

	if(_LA_Cookie.read("unqCheckCookieimp")){
		_Liveads_Src +='&ccheck=nonunique';
	}else{
	//ユニーク
		_Liveads_Src +='&ccheck=unique';
		_LA_Cookie.set("unqCheckCookieimp","true");	
	}
	
	if(!_LiveAds_Ec_Count){
		var _LiveAds_Ec_Count = 0;
	}
	
	var _LiveAds_Iframe ='<iframe allowtransparency="true" id="_LiveAds_Ec_Count_'+ _LiveAds_Ec_Count + '" width="' + width + '" src="' + _Liveads_Src + '" height="' + height + '" scrolling="no" marginheight="0" frameborder="0" hspace="0" vspace="0" style="margin:0px; width:' + width + 'px;"></iframe>';

	document.write(_LiveAds_Iframe);
	
	_LiveAds_Ec_Count++;
}

