
$(document).ready(function(){
 $("#googlemap").ajaxStart(function(){
   $('.message-loading').fadeIn(200);
 });
 $("#googlemap").ajaxComplete(function(){
   $('.message-loading').fadeOut(200);
 });
						   
	$("#googlemap").load("../map/test.html");
	   

	
						   
						   
var newsoption1 = {
  firstname: "mynews",
  secondname: "showhere",
  thirdname:"news_display",
  fourthname:"news_button",
   playingtitle:"現在播放:",
      nexttitle:"下則活動：",
  prevtitle:"上則活動：" 
  //effectspeed:"1000"
  


}
$.init_news(newsoption1);//最近期活動


var newsoption2 = {
  firstname: "mynews1",
  secondname: "showhere1",
  thirdname:"news_display1",
  fourthname:"news_button1",
  playingtitle:"現在播放:",
     nexttitle:"下則活動：",
  prevtitle:"上則活動："
//  effectspeed:"1000"

}
$.init_news(newsoption2);//熱門活動


var newsoption3 = {
  firstname: "mynews2",
  secondname: "showhere2",
  thirdname:"news_display2",
  fourthname:"news_button2",
  playingtitle:"現在播放:",
   nexttitle:"下則揪團：",
  prevtitle:"上則揪團："
  
 // effectspeed:"1000"

}
$.init_news(newsoption3);//最近期揪團


var newsoption4 = {
  firstname: "mynews3",
  secondname: "showhere3",
  thirdname:"news_display3",
  fourthname:"news_button3",
   playingtitle:"現在播放:",
   nexttitle:"下則揪團：",
  prevtitle:"上則揪團："
}
$.init_news(newsoption4);//熱門揪團
var myoffset=$('#news_button').offset();
var myoffset1=$('#news_button1').offset();
var myoffset2=$('#news_button2').offset();
var myoffset3=$('#news_button3').offset();


var mytop=myoffset.top-1;
var mytop1=myoffset1.top-1;
var mytop2=myoffset2.top-1;
var mytop3=myoffset3.top-1;


$('#news_button').css({top:mytop});
$('#news_button1').css({top:mytop1});
$('#news_button2').css({top:mytop2});
$('#news_button3').css({top:mytop3});


//MAP


function formatItem(row) {
		return row[0] + " (<strong>id: " + row[1] + "</strong>)";
	}
	function formatResult(row) {
		return row[0].replace(/(<.+?>)/gi, '');
	}
	$("#name").autocomplete(
"../auto/name.php",{
		formatResult: formatResult}
);

	$("#place").autocomplete("../auto/place.php",
{
		formatResult: formatResult}
);
	$("#addr").autocomplete("../auto/add.php",
{
		formatResult: formatResult}
);


});
$("#mapbutton #doFold").click(function() { 
									
if ($.browser.mozilla ) {
   $("#map_index").slideToggle("fast");
}else {
$("#map_index").toggle("fold", { size: 30, horizFirst: true },  
    800);
}


	

});