﻿$(document).ready(function(){
	$("#Copyright").floatdiv("rightbottom");
	$("a[rel=news_img]").fancybox({
		'overlayOpacity': 0.7,'overlayColor':'#000',
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'titlePosition' 	: 'over'//,
	/*	'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}*/
	});

	if($.browser.msie){
	 userAgent = $.browser.version;
	 userAgent = userAgent.substring(0,userAgent.indexOf('.')); 
	version = userAgent;
		if(version<8){
			alert("您目前的瀏覽器版本：Windows Internet Explorer "+version+"\n\n建議您使用較新的瀏覽器版本，以達到最佳的瀏覽效果。");
		}
			//alert(version);
	}
	setTimeout(function(){load_news();}, 5000);
});
function po_plurk(){
	var strHostName="www.polarstar.tw"
	window.open('http://www.plurk.com/?qualifier=shares&status=' .concat(encodeURIComponent(strHostName)) .concat(' ') .concat('&#40;%E7%A7%80%E5%B1%B1%E8%8E%8A%2B%E7%99%BB%E5%B1%B1%E9%9C%B2%E7%87%9F%E6%97%85%E9%81%8A%E5%B0%88%E8%B3%A3%E5%BA%97&#41;'));
}
function load_news(){
	$('#load_news').show();
}
/*
function news_view(){
	alert("﹝電子郵件﹞格式錯誤!!!");
}
*/
function load_data(str1){
	switch(str1){
		case "products":
			$('#load_Layer').show().load('products.html'); break;
		case "contact":
			$('#load_Layer').show().load('contact.html'); break;
		case "news":
			$('#load_Layer').show().load('news.html'); break;
		case "school":
			$('#load_Layer').show().load('school.html'); break;
		case "e_catalog":
			alert("目前型錄更新中\n\n敬請期待...。");
			//$('#load_Layer').show().load('school.html');
			break;
		case "cf":
			$('#index_music').html('');
			$('#load_Layer').show().load('cf.html'); break;
	}
}
/*
function bg_mask(){
	$('#bg_mask').show().width($(window).width()).height($(window).height());
}
function Cancel_Mask(){
		$('#bg_mask').fadeOut();
}*/
function load_Close(nVal){
	if(nVal=='music_no'){
		var swf='<embed src="flash/music.swf" width="40" height="26" type="application/x-shockwave-flash" quality="high" wmode="transparent">'
		$('#index_music').html(swf);
	}
	//Cancel_Mask();
	$('body').css('overflow-y','hidden');
	//alert("!!!");
	//$('#main_Layer').show();
	$('#load_Layer').html("").hide();
}
function NewsView(nUrl){
	$.fancybox({
		'href' : nUrl,
		//'width' : 540, 'height' : 500,
		'padding' : 10, 'autoScale' : false,
		'transitionIn' : 'none', 'transitionOut'	: 'none',
		'overlayOpacity': 0.7, 'overlayColor' : '#000',
		'type' : 'ajax'
	});
}
