
var AA_ad_debug_mode = 0;
var AA_ad_redirect_path = '//sos.allabout.co.jp/1/Cgi/r.cgi?';
var AA_ad_impgif_path = '//imp.allabout.co.jp/1/Cgi/img/imp_cnt.gif?';
var AA_ad_textcol = 15;
var zSr = '';//for overture
var AA_overture_top_array = new Array();
var AA_ad_top_order = '';
var AA_ad_top_order_array = new Array();

// 
// allabout 48 tiup A
// lastmodified 2006/12/21 rodrigo
// 

function mico_view48(dirname,str,imgadd){

	var ac = '48';
	var text01,text02,text03,text04,text05,text06,text07,text08,text09,text10,pckh,pckd,tmplid,i,j,k,l,m,n,o,header,footer,title,linkurl,desc,imgpath,query1,query2,query3,query4,query5,cell;
	var order = Math.floor( allabout_ary48.length / AA_ad_textcol );

	o = order -1;
	var aaary = new Array(o);
	for (n=0;n<o;n++) aaary[n] = n+1
	for (n=0;n<500;n++){
		k = Math.floor( Math.random() * o );
		l = Math.floor( Math.random() * o );
		m = aaary[k];
		aaary[k] = aaary[l];
		aaary[l] = m;
	}

	if ( order > 1 ){

		if( str == 'center' ){
		tmplid = '480';
		header = '<div id="mico-attention"><h3 class="attention-title">とっておき注目情報</h3><div id="awaku-attention" class="mb15"><table width="505" cellspacing="0" cellpadding="0" border="0" class="vari21">';
		footer = '</table></div></div><!--id="mico-attention"-->';
		}else if( str == 'left' ){
		tmplid = '481';
		header = '<ul id="etc">';
		footer = '<img src="' + AA_ad_impgif_path + 'pckh=000000&ac=' + ac + '&p=' + dirname + '&serial=' + allabout_dateserial + '" border="0" width="1" height="1" alt="" style="display:none"></ul>';
		}

		document.write(header);

		for(j=1;j<order;j++){

			i = aaary[j-1]*AA_ad_textcol;
			text01 = allabout_ary48[i++];
			text02 = allabout_ary48[i++];
			text03 = allabout_ary48[i++];
			text04 = allabout_ary48[i++];
			text05 = allabout_ary48[i++];
			text06 = allabout_ary48[i++];
			text07 = allabout_ary48[i++];
			text08 = allabout_ary48[i++];
			text09 = allabout_ary48[i++];
			text10 = allabout_ary48[i++];
			query1 = allabout_ary48[i++];
			query2 = allabout_ary48[i++];
			query3 = allabout_ary48[i++];
			query4 = allabout_ary48[i++];
			query5 = allabout_ary48[i++];
			title   = text01;
			linkurl = text02
			desc    = text03;
			imgpath = text04;

			if( str == 'center' ){
				cell='<table width="100%" cellspacing="0" cellpadding="0" border="0" class="seriesBox"><tr><td width="1%" valign="top"><a href="' + linkurl + '"><img width="50" height="50" border="0" class="attention-img" alt="" src="' + imgadd + imgpath + '"></a></td><td width="99%" valign="top"><span class="ad22 bo1"><a href="' + linkurl + '">' + title + '</a></span><br /><span class="ad22">' + desc + '</span></td></tr></table>';
				if ( 1 == j%2 ){
					document.write('<tr><td width="247" valign="top">');
					document.write(cell);
					document.write('</td><td width="11" valign="top"><div class="awaku-space"></div></td>');
				}else{
					document.write('<td  width="247" valign="top">');
					document.write(cell);
					document.write('</td></tr>');
				}
			}else if( str == 'left' ){
				linkurl =linkurl.replace("\&tmplid\=480","\&tmplid\=481");
				document.write('<li><a href="' + linkurl + '">' + title + '</a></li>');
			}

		}

		if( (str == 'center' ) && 0 == j%2 ){
			document.write('<td valign="top">&nbsp;</td></tr>');
		}

		document.write(footer);

	}

}



// 
// allabout 123 media top
// lastmodified 2006/12/22 rodrigo
// 

function mico_view123(dirname,str,imgadd){

	var ac = '123';
	var text01,text02,text03,text04,text05,text06,text07,text08,text09,text10,pckh,pckd,tmplid,i,j,k,l,m,n,o,header,footer,title,linkurl,desc,imgpath,query1,query2,query3,query4,query5,cell;
	var order = Math.floor( allabout_ary123.length / AA_ad_textcol );

	o = order -1;
	var aaary = new Array(o);
	for (n=0;n<o;n++) aaary[n] = n+1
	for (n=0;n<500;n++){
		k = Math.floor( Math.random() * o );
		l = Math.floor( Math.random() * o );
		m = aaary[k];
		aaary[k] = aaary[l];
		aaary[l] = m;
	}

	if ( order > 1 ){

		if( str == 'center' ){
		tmplid = '1230';
		header = '';
		footer = '';
		}else if( str == 'left' ){
		tmplid = '1231';
		header = '';
		footer = '<img src="' + AA_ad_impgif_path + 'pckh=000000&ac=' + ac + '&p=' + dirname + '&serial=' + allabout_dateserial + '" border="0" width="1" height="1" alt="" style="display:none">';
		}

		document.write(header);

		for(j=1;j<order;j++){

			i = aaary[j-1]*AA_ad_textcol;
			text01 = allabout_ary123[i++];
			text02 = allabout_ary123[i++];
			text03 = allabout_ary123[i++];
			text04 = allabout_ary123[i++];
			text05 = allabout_ary123[i++];
			text06 = allabout_ary123[i++];
			text07 = allabout_ary123[i++];
			text08 = allabout_ary123[i++];
			text09 = allabout_ary123[i++];
			text10 = allabout_ary123[i++];
			query1 = allabout_ary123[i++];
			query2 = allabout_ary123[i++];
			query3 = allabout_ary123[i++];
			query4 = allabout_ary123[i++];
			query5 = allabout_ary123[i++];

			title    = text01;
			linkurl  = text02
			desc     = text03;
			imgpath  = text04;
			imgpath2 = text05;
			series   = text06;
			longtext = text07;

			if( str == 'center' ){
				if(j==1){
					document.write('<table cellspacing="0" cellpadding="0" border="0" class="seriesBox-w"><tr><td width="99%" valign="top"><span class="series-title vari21 bo1">'+title+'</span><br/><span class="series-volTitle vari21"><a href="'+linkurl+'">'+longtext+'</a></span></td><td width="1%" valign="top"><a href="'+linkurl+'"><img width="153" height="65" border="0" src="'+imgadd+imgpath+'" alt="" class="series-img"/></a></td></tr></table>');
				}else{
					document.write('<table width="247" cellspacing="0" cellpadding="0" border="0" class="seriesBox-l"><tr><td width="99%" valign="top"><span class="series-title vari21 bo1">'+title+'</span><br/><span class="series-volTitle vari21">・<a href="'+linkurl+'">'+desc+'</a></span></td><td width="1%" valign="top"><a href="'+linkurl+'"><img width="50" height="50" border="0" src="'+imgadd+imgpath2+'" alt="" class="series-img"/></a></td></tr></table>');
				}
			}else if( str == 'left' ){
				linkurl =linkurl.replace("\&tmplid\=1230","\&tmplid\=1231");
				document.write('<li class="s-tu-L"><a href="' + linkurl + '">' + title + '</a></li>');
			}
		}
		document.write(footer);
	}
}

// 
// allabout 124 waku c
// lastmodified 2006/12/22 rodrigo
// 

function mico_view124(dirname,str,imgadd){

	var ac = '124';
	var text01,text02,text03,text04,text05,text06,text07,text08,text09,text10,pckh,pckd,tmplid,i,j,k,l,m,n,o,header,footer,title,linkurl,desc,imgpath,query1,query2,query3,query4,query5,cell;
	var order = Math.floor( allabout_ary124.length / AA_ad_textcol );

	o = order -1;
	var aaary = new Array(o);
	for (n=0;n<o;n++) aaary[n] = n+1
	for (n=0;n<500;n++){
		k = Math.floor( Math.random() * o );
		l = Math.floor( Math.random() * o );
		m = aaary[k];
		aaary[k] = aaary[l];
		aaary[l] = m;
	}

	if ( order > 1 ){

		if( str == 'center' ){
		tmplid = '1240';
		header = '<div id="awaku-department"><table width="505" cellspacing="0" cellpadding="0" border="0" class="vari21">';
		footer = '</table></div>';
		}else if( str == 'left' ){
		tmplid = '1241';
		header = '<ul id="department">';
		footer = '<img src="' + AA_ad_impgif_path + 'pckh=000000&ac=' + ac + '&p=' + dirname + '&serial=' + allabout_dateserial + '" border="0" width="1" height="1" alt="" style="display:none"></ul>';
		}else if( str == 'right' ){
		tmplid = '1242';
		header = '<div class="mico_right"><div class="mico-block">';
		footer = '</div></div>';
		}

		document.write(header);

		for(j=1;j<order;j++){

			i = aaary[j-1]*AA_ad_textcol;
			text01 = allabout_ary124[i++];
			text02 = allabout_ary124[i++];
			text03 = allabout_ary124[i++];
			text04 = allabout_ary124[i++];
			text05 = allabout_ary124[i++];
			text06 = allabout_ary124[i++];
			text07 = allabout_ary124[i++];
			text08 = allabout_ary124[i++];
			text09 = allabout_ary124[i++];
			text10 = allabout_ary124[i++];
			query1 = allabout_ary124[i++];
			query2 = allabout_ary124[i++];
			query3 = allabout_ary124[i++];
			query4 = allabout_ary124[i++];
			query5 = allabout_ary124[i++];

			title    = text01;
			linkurl  = text02
			desc     = text03;
			imgpath  = text04;
			imgpath2 = text05;
			series   = text06;
			longtext = text07;

			if( str == 'center' ){
				cell='<table width="100%" cellspacing="0" cellpadding="0" border="0" class="mb05"><tr><td width="1%" valign="top"><a href="' + linkurl + '"><img width="85" height="60" border="0" class="mr10" alt="" src="' + imgadd + imgpath2 + '"></a></td><td width="99%" valign="top"><span class="ad-title ad22 bo1"><a href="' + linkurl + '">' + title + '</a></span><br /><span class="ad22">' + desc + '</span></td></tr></table>';
				if ( 1 == j%2 ){
					document.write('<tr><td width="248" valign="top">');
					document.write(cell);
					document.write('</td><td width="9" valign="top"><div class="awaku-space"></div></td>');
				}else{
					document.write('<td  width="248" valign="top">');
					document.write(cell);
					document.write('</td></tr>');
				}
			}else if( str == 'left' ){
				linkurl =linkurl.replace("\&tmplid\=1240","\&tmplid\=1241");
				document.write('<li><a href="' + linkurl + '">' + title + '</a></li>');
			}else if( str == 'right' ){
				linkurl =linkurl.replace("\&tmplid\=1240","\&tmplid\=1242");
				document.write('<div class="right-department-box"><div class="right-department"><a href="' + linkurl + '"><img width="135" height="65" border="0" class="right-department-img" alt="" src="' + imgadd + imgpath + '"></a> </div><p class="right-department-rink vari21 bo1"><a href="' + linkurl + '">' + title + '</a></p><p class="right-department-read vari21">' + desc + '</p></div>');
			}

			if( j == (order-1) && str == 'center' ){
				if ( 1 == j%2 ){document.write('<td  width="248" valign="top"><div class="awaku-space"></div></td></tr>');}
			}

		}

		document.write(footer);

	}

}

// 
// allabout 125 waku d
// lastmodified 2006/12/22 rodrigo
// 

function mico_view125(dirname,str,imgadd){

	var ac = '125';
	var text01,text02,text03,text04,text05,text06,text07,text08,text09,text10,pckh,pckd,tmplid,i,j,k,l,m,n,o,header,footer,title,linkurl,desc,imgpath,query1,query2,query3,query4,query5,cell;
	var order = Math.floor( allabout_ary125.length / AA_ad_textcol );

	o = order -1;
	var aaary = new Array(o);
	for (n=0;n<o;n++) aaary[n] = n+1
	for (n=0;n<500;n++){
		k = Math.floor( Math.random() * o );
		l = Math.floor( Math.random() * o );
		m = aaary[k];
		aaary[k] = aaary[l];
		aaary[l] = m;
	}

	if ( order > 1 ){

		if( str == 'center' ){
		tmplid = '1250';
		header = '<div id="awaku-drugstore">';
		footer = '</div>';
		}else if( str == 'left' ){
		tmplid = '1251';
		header = '<ul id="drugstore">';
		footer = '<img src="' + AA_ad_impgif_path + 'pckh=000000&ac=' + ac + '&p=' + dirname + '&serial=' + allabout_dateserial + '" border="0" width="1" height="1" alt="" style="display:none"></ul>';
		}

		document.write(header);

		for(j=1;j<order;j++){

			i = aaary[j-1]*AA_ad_textcol;
			text01 = allabout_ary125[i++];
			text02 = allabout_ary125[i++];
			text03 = allabout_ary125[i++];
			text04 = allabout_ary125[i++];
			text05 = allabout_ary125[i++];
			text06 = allabout_ary125[i++];
			text07 = allabout_ary125[i++];
			text08 = allabout_ary125[i++];
			text09 = allabout_ary125[i++];
			text10 = allabout_ary125[i++];
			query1 = allabout_ary125[i++];
			query2 = allabout_ary125[i++];
			query3 = allabout_ary125[i++];
			query4 = allabout_ary125[i++];
			query5 = allabout_ary125[i++];

			title    = text01;
			linkurl  = text02
			desc     = text03;
			imgpath  = text04;
			imgpath2 = text05;
			series   = text06;
			longtext = text07;

			if( str == 'center' ){

				if( j == 1 ){
					document.write('<div id="awaku-drugstore-top"><table width="505" cellspacing="0" cellpadding="2" border="0" class="vari21"><tr><td width="100%" valign="top"><span class="ad-title-t vari32 bo1"><a href="' + linkurl + '">' + series + '</a></span><br /><span class="ad-read ad22">' + longtext + '</span></td><td width="1%" valign="top"><a href="' + linkurl + '"><img width="140" height="90" border="0" class="awaku-Img" alt="" src="' + imgadd + imgpath + '"></a></td></tr></table></div>');
				}else{
					if( j == 2 ){document.write('<div id="awaku-drugstore-bottom"><table width="505" cellspacing="0" cellpadding="0" border="0" class="vari21">');}
					cell='<table width="100%" cellspacing="0" cellpadding="0" border="0" class="mb05"><tr><td width="99%" valign="top"><span class="ad-title ad22 bo1"><a href="' + linkurl + '">' + title + '</a></span><br /><span class="ad22">' + desc + '</span></td><td width="1%" valign="top"><a href="' + linkurl + '"><img width="85" height="60" border="0" class="awaku-Img" alt="" src="' + imgadd + imgpath2 + '"></a></td></tr></table>';
					if ( 0 == j%2 ){
						document.write('<tr><td width="248" valign="top">');
						document.write(cell);
						document.write('</td><td width="9" valign="top"><div class="awaku-space"></div></td>');
					}else{
						document.write('<td  width="248" valign="top">');
						document.write(cell);
						document.write('</td></tr>');
					}
					if( j == (order-1) ){
						if ( 0 == j%2 ){document.write('<td  width="248" valign="top"><div class="awaku-space"></div></td></tr>');}
						document.write('</table></div>');
					}
				}

			}else if( str == 'left' ){
				linkurl =linkurl.replace("\&tmplid\=1250","\&tmplid\=1251");
				document.write('<li><a href="' + linkurl + '">' + title + '</a></li>');
			}

		}

		document.write(footer);

	}

}





// 
// allabout brand index headfoot c124 d125 a48
// lastmodified 2007/02/13 rodrigo
// 

function mico_brandindex_headfoot(pat){
	var ret = pat=='head'?'<div id="brandIndex" class="vari21"><h3><a href="#">気になるブランドINDEX<\/a><\/h3>':'<\/div>';
	var couD = Math.floor( allabout_ary125.length / AA_ad_textcol );
	var couC = Math.floor( allabout_ary124.length / AA_ad_textcol );
	var couA = Math.floor( allabout_ary48.length / AA_ad_textcol );
	var writeFLG = (couD+couC+couA)>3?1:0;
	if(writeFLG==1)document.write(ret);
}




