function setGMap(elm, map){



		



		if(elm != null && !elm.hasClass('no-selected')){



			return;



		}



		



		$('.tab-block > li').removeClass('no-selected');



		



		$('#shop-map').html('<img src="common/images/map/map_' + map + '.jpg" alt="地図" />');



		$('#shop-pht').html('<img src="common/images/map/pht_' + map + '.jpg" alt="外観" />');



		



		var html;



		switch(map){



		case "aoyama":



			$('li.tab_b').addClass('no-selected');



			html = '<dl class="last-child"><dt>青山店</dt><dd>03-5772-3266／東京都渋谷区神宮前 4-2-14 ／営業時間 11:00〜20:00 (<a href="http://maps.google.co.jp/maps?f=q&source=s_q&hl=ja&geocode=&q=%E6%9D%B1%E4%BA%AC%E9%83%BD%E6%B8%8B%E8%B0%B7%E5%8C%BA%E7%A5%9E%E5%AE%AE%E5%89%8D+4-2-14&sll=35.647097,139.735026&sspn=0.011508,0.01236&brcurrent=3,0x60188ca22bf7814d:0xb66e2492eb3c1cf2,0&ie=UTF8&hq=&hnear=%E6%9D%B1%E4%BA%AC%E9%83%BD%E6%B8%8B%E8%B0%B7%E5%8C%BA%E7%A5%9E%E5%AE%AE%E5%89%8D%EF%BC%94%E4%B8%81%E7%9B%AE%EF%BC%92%E2%88%92%EF%BC%91%EF%BC%94&z=16" target="_blank">Googleマップ</a>)</dd></dl>';



			break;



			



		case "nishiumeda":



			$('li.tab_a').addClass('no-selected');



			html = '<dl><dt>西梅田店</dt><dd>06-6442-8763／大阪府大阪市北区梅田2-4-9 ブリーゼブリーゼ1F／営業時間 11:00～21:00  (<a href="http://maps.google.co.jp/maps?f=q&source=s_q&hl=ja&geocode=&q=%E5%A4%A7%E9%98%AA%E5%BA%9C%E5%A4%A7%E9%98%AA%E5%B8%82%E5%8C%97%E5%8C%BA%E6%A2%85%E7%94%B0+2-4-9&sll=35.666466,139.711039&sspn=0.011506,0.01236&brcurrent=3,0x6000e68cbaa9e3a5:0x856ebc92bba1825f,0&ie=UTF8&hq=&hnear=%E5%A4%A7%E9%98%AA%E5%BA%9C%E5%A4%A7%E9%98%AA%E5%B8%82%E5%8C%97%E5%8C%BA%E6%A2%85%E7%94%B0%EF%BC%92%E4%B8%81%E7%9B%AE%EF%BC%94%E2%88%92%EF%BC%99&z=16" target="_blank">Googleマップ</a>)</dd></dl><p>※掲載の営業時間はシーズンにより異なります。詳しくは<a href="http://www.breeze-breeze.jp/" target="_blank">ブリーゼブリーゼのサイト</a>でご確認ください。</p>';



			break;



		}



		$('#shop-txt').html(html);







}







$(function(){



	



	var map_a = 'aoyama';



	var map_b = 'nishiumeda';



	



	$('li.tab_a').click(function(){



		setGMap($(this), map_a)



	});



	



	$('li.tab_b').click(function(){



		setGMap($(this), map_b)



	});



	



	setGMap(null, map_a)

	

	

	

	//LULU'S SCOPE

	

	var sxml;



	$.ajax({



		url:'common/files/proxy.php?url=http://blog.editforlulu.jp/?mode=rss',



		type: 'GET',



		dateType: 'xml',



		success:function(xml){



		var count = 0;



		



		$(xml).find('item').each(function(artcle){



		if (count == 0) {



			var stitle = $(this).find('title').text();



			$('#article-title').append(stitle);



			var stxt = $(this).find('description').text();



			$('#article-txt').append(stxt);



			var scata = $(this).find('[nodeName="dc:subject"]').text().toLowerCase();


			$('#pht-cate').html($('<img src="common/images/blog/blog_category/'+scata+'.gif" width="353" height="112" alt="'+scata+'" />'))



			



			var sconts = $(this).find('[nodeName="content:encoded"]').text();



			



			var regex = /<img(.+?)>/i;



			var img = regex.exec(sconts)[0];



			var src = $(img).attr("src");



			



			$('#box-scope-pht').append('<a href="http://blog.editforlulu.jp/" target="_blank"><img src="common/files/proxy.php?url='+src+'" /></a>');



			count = count + 1;



		} else {



			return false;



		}



     });



  



  



	}



	});



	//Style Cruise

	

	var scxml;



	$.ajax({



		url:'common/files/proxy.php?url=http://style-cruise.jp/dat/editforlulu.xml',

		//url:'http://mogra.net/TestPhase/HUNCH/editforlulu/test.xml',

		type: 'GET',



		dateType: 'xml',



		success:function(xml){

		

		var count = 0;

		

		$(xml).find('item').each(function(artcle){

		

			if (count < 5) {

			

				var link = $(this).find('link').text();

				

			

				var txt = $(this).find('description').text();

				

				var regex = /<img.+?\/>/i;

			

				var img = regex.exec(txt)[0];

			

				var src = $(img).attr("src");

			

				$('#box-stylecruise').append('<li><a href="'+link+'" target="_blank"><img src="'+src+'" alt="" /></a></li>');

				

				count++;

			

			} else {

			

				return false;

			

			}

		});

  



  



	}



	});

	



		



	$('#slide').jcarousel({



    	scroll: 1,



    	wrap: 'both',



    	initCallback: mycarousel_initCallback,



    	buttonNextHTML: null,



        buttonPrevHTML: null,



    		itemVisibleInCallback: {



	    	onBeforeAnimation: function(carousel, item, idx, state){



	    		$('.news-selected').removeClass('news-selected');



	    		$("#slide"+idx).addClass('news-selected');



	       }



    	}



    });



    



    $('#block-txt-news ul li').hover(function(){



		$(this).addClass('hover');



	},function(){



		$(this).removeClass('hover');



	});



	







});







function mycarousel_initCallback(carousel) {



    $('.control-slide li').bind('click', function() {



    	if($(this).hasClass('news-selected')){



    		location.href = $(this).children("div").children("h4").children("a").attr("href");



    	}else{



		   	$('.news-selected').removeClass('news-selected');



	    	$(this).addClass('news-selected');



	      carousel.scroll($.jcarousel.intval($(this).attr('id').slice(-1)));



	      return false;



      }



    });







    $('#next-slide').bind('click', function() {



        carousel.next();



        return false;



    });







    $('#prev-slide').bind('click', function() {



        carousel.prev();



        return false;



    });



};











function jsonFlickrApi(obj) {



	var ps = obj.photos.photo;



	for(var p in ps){



		var li = $("<li></li>");



		$("#box-flickr").append(li);



		li.oembed("http://www.flickr.com/photos/"+ps[p].owner+"/"+ps[p].id+"/",{embedMethod: "fill"});



		



	}



}







function vimeoCallback(arr){



	



	var len = arr.length > 2 ? 2 : arr.length;



	for(var i = 0; i < len; i++){



		var li = $("<li></li>");



		$("#box-vimeo").append(li);



		li.oembed("http://vimeo.com/" + arr[i].id,{



			embedMethod: "fill",



			maxWidth:210,



			vimeo: {maxWidth:210}



		});



	}



}







$(function(){   



	//flickr



	$.ajax({



		url: "http://api.flickr.com/services/rest/",



		data: {



			api_key: "c21419b8de8e8c652727e5fdad4b0ca6",



	    type: "people",



	    method: "flickr.people.getPublicPhotos",



	    photoset_id: "72157622251688095",



	    thumb_size: "f",



	    user_id: "48265796@N04",



	    per_page: 5,



	    extras: "last_update",



	    format: "json"



		},



		dataType: "jsonp"



	});



	//vimeo



	/*



	$.ajax({



		url: "http://vimeo.com/api/v2/channel/editforlulu/videos.json",



		data: {



	    callback: "vimeoCallback",



	    format: "jsonp"



		},



		dataType: "jsonp"



	});



	*/

	



	$(function(){



		$.each($(".box-closet"),function(){



			var conts = $(this);



			conts.hide();



			



			$(this).prev().bind('click', function(){



				$.modal(conts);



			})



		});



	})



	



})




