
/* 表示させたい画像へのパスをカンマで区切って記述する */
var gazo = new Array("images_main/06.jpg", "images_main/01.jpg","images_main/02.jpg","images_main/03.jpg","images_main/04.jpg","images_main/05.jpg");

/* 表示させたい画像の順番に合わせてリンク先のパスをカンマで区切って記述する */
var link = new Array("topfla-special_sale.php?fla", "topfla-saishin_smartphone.php?fla","topfla-sugutukaeru_tyukokeitai.php?fla","topfla-kiseinashi_anshin.php?fla","topfla-makerhosyo_anshin.php?fla","topfla-hojinsama.php?fla");

var alt = new Array("PRICE DOWN!!", "人気のスマートフォンの白ロム","白ロムはSIMカードを差しかえるだけ","規制無しの白ロム携帯","メーカー保証付き白ロム携帯","法人様へのご案内");

var timer;
var x = 0;

function show(num)
{
	clearTimeout(timer);

	/* サムネイル画像がクリックされた時はxの数値を変更します */
	if (num != 999)
	{
		x = num;
	}

	/* id名がancのaタグのリンクを変更します */
	document.getElementById('anc').setAttribute('href', link[x]);
	/* id名がmainphotoの中になるimgタグの画像を変更します */
	$("#mainphoto img").before("<img src='"+gazo[x]+"' alt='"+alt[x]+"'>");

	/* fadeOutの速度は、slow、normal、fast、もしくは完了までの時間をミリ秒単位で指定します。*/
	$("#mainphoto img:last").fadeOut("normal",function(){
            $(this).remove()
    });

	/* 何枚目の画像を表示するか設定します。
		変数xで何枚目かを管理します。show()が実行される度にxの値を1加算します。
		gazo.lengthでgazo配列の要素の数が分かります。
		画像は0番目から数えるので「スライドする画像の数 - 1」の値になれば0に戻します */
	if ( x == gazo.length - 1 )	/* 「スライドする画像の枚数 - 1 」の値を設定 */
	{
		x = 0;		/* 画像の番号を0(1枚目)に戻す */
	}
	else
	{
		x = x + 1;	/* 画像の番号を1つ進める */
	}

	/* 「setTimeout("show()", 3000)」の3000でスライドする時間を変更します。 3000は3秒です。*/
	timer = setTimeout("show(999)", 5000);

};


/*ここから　　旧スクリプト削除予定*/

$(document).ready(function()
{
	$("#showcase").awShowcase(
	{
		content_width:			630,
		content_height:			252,
		fit_to_parent:			false,
		auto:					true,
		interval:				5000,
		continuous:				true,
		loading:				true,
		tooltip_width:			1000,
		tooltip_icon_width:		32,
		tooltip_icon_height:	32,
		tooltip_offsetx:		18,
		tooltip_offsety:		0,
		arrows:					false,
		buttons:				false,
		btn_numbers:			false,
		keybord_keys:			true,
		mousetrace:				false, /* Trace x and y coordinates for the mouse */
		pauseonover:			true,
		stoponclick:			false,
		transition:				'fade', /* hslide/vslide/fade */
		transition_delay:		100,
		transition_speed:		300,
		show_caption:			false, /* onload/onhover/show */
		thumbnails:				true,
		thumbnails_position:	'outside-last', /* outside-last/outside-first/inside-last/inside-first */
		thumbnails_direction:	'horizontal', /* vertical/horizontal */
		thumbnails_slidex:		1, /* 0 = auto / 1 = slide one thumbnail / 2 = slide two thumbnails / etc. */
		dynamic_height:			false, /* For dynamic height to work in webkit you need to set the width and height of images in the source. Usually works to only set the dimension of the first slide in the showcase. */
		speed_change:			false, /* Set to true to prevent users from swithing more then one slide at once. */
		viewline:				false /* If set to true content_width, thumbnails, transition and dynamic_height will be disabled. As for dynamic height you need to set the width and height of images in the source. */
	});
});
