//縮圖列表 ，自動高亮
$(function(){
	$(".thumb_z li.normal h2").prepend('<span class="ui-icon ui-icon-triangle-1-e" style="float:left; margin-top:6px">icon</span>');
	$(".thumb_z li.current h2").prepend('<span class="ui-icon ui-icon-heart" style="float:left; margin-top:6px">icon</span>');
	$(".thumb_z li.current .box_1").addClass('ui-state-highlight');
});

//以下兩個JS要依以下次序出現，不則FF會有問題
//LazyLoad：控制指定條件下的前幾張圖要直接顯示
$(document).ready(function(){
	$("#photos img:lt(6)").each(function(){
		var imgsrc = $(this).attr("rel");
		$(this).attr("src",imgsrc);
	})
})

//LazyLoad：指定要適用LazyLoad的圖片條件
$(function() {          
	$("#photos img").lazyload({
	 placeholder : "images/loadingAnimation.gif",
	 effect: "fadeIn"
	});
});

//縮圖列表, 圖片div內置中
$(document).ready(function(){
	$("#photos .box_2").each(function(){
		boxh = $(this).height();
		imgh = $(this).find("img").height();
		if(imgh<=0) {imgh=boxh}; //修正google
		marh = parseInt((boxh - imgh) / 2 );
		if(marh<=0) {marh=0};
		$(this).find("img").css({"margin-top": marh+"px"})
	});
});

//控制錨點
$(document).ready(function($){
    $('#anchor_bt01, #anchor_bt02, #post').click(function(){
        $('#anchor01').ScrollTo(500);
    });
});


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
