$(document).ready(function(){
	if($('#aotPriceCenter')){
		
		var jsonText = $.ajax({url: "/common/js/priceJson.json",async: false});
		eval("var crsArray="+jsonText.responseText);
		
		
		$('#aotPriceCenter .thumbs img').each(function(i){
			var myhref = $(this).attr('src').replace("_tn","");
			var myalt = $(this).attr('alt');
			var imgs = $("<img></img>").attr({
				src: myhref,
				title: myalt,
				alt: myalt,
				id: 'view'+(i+1),
				width: '360',
				height: '200'
			});
			imgs.hide();
			$('#aotPriceCenter .view').append(imgs);
			$(this).mouseover(function(){
				$('#aotPriceCenter .view img').hide();
				$('#view'+(i+1)).fadeIn();
			});
		});
		
		$('.priceList li').each(function(i){
			if($(this).attr('class') != 'clear noclick' && $(this).attr('class') != 'clear noclick last'){
				$(this).css({ cursor:"pointer" });
				$(this).click(function(){
					$('.priceList li').css({ backgroundColor:"transparent", color:"#CCCCCC" });
					$(this).css({ backgroundColor:"#659833", color:"#ffffff" });
					var crsID = $(this).attr('id');
					$('#aotPriceCenter .txt').html(crsArray[crsID]["disc"]);
					$('#thumb1').attr({src:'../common/images/'+crsID+'_img_01_tn.jpg'});
					$('#thumb2').attr({src:'../common/images/'+crsID+'_img_02_tn.jpg'});
					$('#thumb3').attr({src:'../common/images/'+crsID+'_img_03_tn.jpg'});
					$('#view1').attr({src:'../common/images/'+crsID+'_img_01b.jpg'});
					$('#view2').attr({src:'../common/images/'+crsID+'_img_02b.jpg'});
					$('#view3').attr({src:'../common/images/'+crsID+'_img_03b.jpg'});
					$('#aotPriceCenter .view img').hide();
					$('#view1').show();
				});
			} else {
				$(this).css({ cursor:"default" });
			}
		});
	}
});