﻿// 網頁本身的HTML"載入後就觸發.
$(document).ready(function(){
	//alert("ready!!");
	var send_contact_us=[0,0,0];
	
	// 最新消息資料(json).
	var main_new = "";
	// 最新消息現在選項.
	var new_select=0;	
	// 最新消息圖層.
	var new_layer=false;	
	
	/*
	//----------------------------------------------------------------------
	// 最新消息資料.
	var delight_head		= new Array(8);		// 訊息標題 .		
	var delight_timestart	= new Array(8);		// 訊息自動上架時間.
	var delight_timeout 	= new Array(8);		// 訊息自動下架時間.
	
	var img_name1			= new Array(8);		// 圖片名稱1.
	var movie_name1			= new Array(8);		// 影片名稱1.
	var movie_href1			= new Array(8);		// 影片連結1.
	var content_head1		= new Array(8);		// 內文訊息標題1.
	var action_href1		= new Array(8);		// 活動連結1.
	var show_img1			= new Array(8);		// undefined 顯示圖片 的網址1.
	var content_txt1		= new Array(8);		// 訊息內容1.

	var img_name2			= new Array(8);		// 圖片名稱2.
	var movie_name2			= new Array(8);		// 影片名稱2.
	var movie_href2			= new Array(8);		// 影片連結2.
	var content_head2		= new Array(8);		// 內文訊息標題2.
	var action_href2		= new Array(8);		// 活動連結2.
	var show_img2			= new Array(8);		// undefined 顯示圖片 的網址2.
	var content_txt2		= new Array(8);		// 訊息內容2.
	
	var img_name3			= new Array(8);		// 圖片名稱3.
	var movie_name3			= new Array(8);		// 影片名稱3.
	var movie_href3			= new Array(8);		// 影片連結3.
	var content_head3		= new Array(8);		// 內文訊息標題3.
	var action_href3		= new Array(8);		// 活動連結3.
	var show_img3			= new Array(8);		// undefined 顯示圖片 的網址3.
	var content_txt3		= new Array(8);		// 訊息內容3.
	
	for(var i=0; i<delight_head.length; i++){
		delight_head		= "";		
		delight_timestart	= "";
		delight_timeout 	= "";
		
		img_name1			= "";
		movie_name1			= "";
		movie_href1			= "";
		content_head1		= "";
		action_href1		= "";
		show_img1			= "";
		content_txt1		= "";

		img_name2			= "";
		movie_name2			= "";
		movie_href2			= "";
		content_head2		= "";
		action_href2		= "";
		show_img2			= "";
		content_txt2		= "";
		
		img_name3			= "";
		movie_name3			= "";
		movie_href3			= "";
		content_head3		= "";
		action_href3		= "";
		show_img3			= "";
		content_txt3		= "";		
	}
	*/
	
	/*
	//----------------------------------------------------------------------			
	// new-1.
	new_title[0]		="限量變形金剛盒裝面紙搶購中";	
	new_file_name[0]	="picture/img02.jpg";
	new_pic_name[0]		="得意變形金剛盒裝面紙";
	new_message[0]		="限量變形金剛盒裝面紙搶購中";
	new_date_begin[0]	="即日起";
	new_date_end[0]		="2011.8(數量有限, 售完為止)";
	new_content[0]		="限量變形金剛盒裝面紙，給你不含有害化學物質、使用人造林紙漿、400度高溫殺菌、不含螢光劑、不染色的五重保證！讓得意和變形金剛跟你安全 Give Me 5!<br/><br/>販售通路：<br>家樂福、屈臣氏、康是美、萊爾富、OK Mart、Yahoo奇摩購物中心、Pchome商店街、momo富邦購物網，及各大連鎖超商";		
	new_link[0]			="http://www.delight.com.tw/popup/";
	// new-2.
	new_title[1]		="限量變形金剛旅行包面紙搶購中";	
	new_file_name[1]	="picture/img01.jpg";
	new_pic_name[1]		="得意變形金剛旅行包面紙";
	new_message[1]		="限量變形金剛旅行包面紙搶購中";
	new_date_begin[1]	="即日起";
	new_date_end[1]		="2011.9(數量有限, 售完為止)";
	new_content[1]		="限量變形金剛旅行包面紙，給你不含有害化學物質、使用人造林紙漿、400度高溫殺菌、不含螢光劑、不染色的五重保證！讓得意和變形金剛跟你安全 Give Me 5!<br><br/>販售通路：<br>全聯獨家販售";
	new_link[1]			="http://www.delight.com.tw/popup/";
	// new-3.
	new_title[2]		="買得意送你變形金剛限量文件夾";	
	new_file_name[2]	="picture/img03.jpg";
	new_pic_name[2]		="得意變形金剛文件夾";
	new_message[2]		="買得意送你變形金剛限量文件夾";
	new_date_begin[2]	="即日起";
	new_date_end[2]		="2011.8 (數量有限, 售完為止)";
	new_content[2]		="即日起，凡至各通路購買得意系列商品，就有機會獲得變形金剛限量文件夾，數量有限，送完為止。<br>詳細活動辦法，請詳見各通路公告。";
	new_link[2]			="http://www.delight.com.tw/popup/";
		
	// new-4.
	new_title[3]		="買得意抽變形金剛限量玩具組";	
	new_file_name[3]	="picture/img04.jpg";
	new_pic_name[3]		="";
	new_message[3]		="買得意抽變形金剛限量玩具組";
	new_date_begin[3]	="即日起";
	new_date_end[3]		="2011.8.31";
	new_content[3]		="即日起，凡購買得意系列商品，收集外袋包裝條碼任兩枚，黏貼於得意集條碼卡或明信片上，並附上個人聯絡方式（姓名、電話、手機號碼、地址、性別、年齡），寄至：115南港郵政2150號信箱「得意變形金剛活動小組」收，就有機會把變形金剛帶回家。<br><br>抽獎日期：<br>100/9/9（9/21於得意官網公佈中獎名單）<br><br>獎項：<br>"+
	"頭獎- 終極戰將+無敵戰將玩具組（一組共4隻，建議零售價10,696元）10名<br>貳獎-巡弋戰將玩具組（一組共3隻，建議零售價2,997元）50名<br>參獎-博派/狂派 8G隨身碟（隨機出貨一款，建議零售價1,199元）100名<br>肆獎-變形金剛盒裝面紙3入1箱（建議零售價1,104元）100名<br>";
	new_link[3]			="http://www.delight.com.tw/popup/";	
	
	//----------------------------------------------------------------------
	// 函數.
	get_new_titl 		= function(id){
		return new_title[id];
	};		
	get_new_file_name	= function(id){
		return new_file_name[id];
	};
	get_new_pic_name 	= function(id){
		return new_pic_name[id];
	};
	get_new_message		= function(id){
		return new_message[id];
	};	
	get_new_date_begin 	= function(id){
		return new_date_begin[id];
	};
	get_new_date_end	= function(id){
		return new_date_end[id];
	};
	get_new_content		= function(id){
		return new_content[id];
	};
	get_new_link		= function(id){
		return new_link[id];
	};
	*/		
	get_new_data		= function(){
		return main_new;
	}
	get_new_select		= function(){
		return new_select;
	};	
	
    //----------------------------------------------------------------------
    // 函數：取得時間.	
	get_Timer = function(){	
		RightNow = new Date();
		return RightNow.getFullYear()+":"+(RightNow.getMonth()+1)+":"+RightNow.getDate()+":"+RightNow.getHours()+":"+RightNow.getMinutes()+":"+RightNow.getSeconds();
	};	
	
	//window.open("../../delightman/delight_getshow.php");
	//window.open("www.google.com.tw");
	//top.window.location.href="../delightman/delight_getshow.php";
		
	// 取得首頁-最新消息.
	dataT = "";
	dataT = get_Timer();
    var queryStr = {data:dataT};	
	$.ajax({
		url:'../delightman/delight_getshow.php',
		//url:'http://brandsugar.co/delight/delightman/delight_getshow.php',
		data: queryStr,
		type: 'get',
		dataType: 'json',
		success: function (data) {
			main_new = "";
			main_new = data;
			
			//for(var i=0; i<main_new.length; i++){
			//	alert(main_new[i]['show_img1']);
			//}
			
			//alert(main_new[0]['delight_head']);
			
			/*
			// 讀取資料.
			for(var i=0; i<main_new.length; i++){				
				// 最多只顯示8個訊息.
				if ((i>7)||(main_new[i]['delight_head']=="")){
					break;
				}
				delight_head[i] 			= main_new[i]['delight_head'];
				delight_timestart[i]		= main_new[i]['delight_timestart'];
				delight_timeout[i]			= main_new[i]['delight_timeout'];
				
				img_name1[i]				= main_new[i]['img_name1'];
				movie_name1[i]				= main_new[i]['movie_name1'];
				movie_href1[i]				= main_new[i]['movie_href1'];
				content_head1[i]			= main_new[i]['content_head1'];
				action_href1[i]				= main_new[i]['action_href1'];
				show_img1[i]				= main_new[i]['show_img1'];
				content_txt1[i]				= main_new[i]['content_txt1'];
				
			}
			*/
			//alert(main_new.length);
			
			//----------------------------------------------------------------------	
		    // 顯示最新消息.
			// 註：這裡的寫法比較特別使用了備頁的觀念，這樣可以使載入頁面的時候不會閃塑.
			if(main_new.length>0){
		    $('#content_2_1_1_1').html('<img src="images/dot.png"></img><a href="#">'+ main_new[0]['delight_head'] +'</a>')
		    .bind('click', function(){   	
				// 捲動箭頭.
				$("#content_2_3").animate({
					top : '-780px'
				},300, function(){
			    	if($('#content_2_1_2').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','20')
			    		$('#content_2_1_2').css('filter','alpha(opacity=100)')
			    		$('#content_2_1_3').css('z-index','10')
			    		$('#content_2_1_3').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_3').html('');
			    	}else if($('#content_2_1_3').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','10')	    		
			    		$('#content_2_1_2').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_2').html('');    			    		
			    		$('#content_2_1_3').css('z-index','20')
			    		$('#content_2_1_3').css('filter','alpha(opacity=100)')
			    	}
				});
				// 設定現在選項編號.
		    	new_select=0;    	    	
		    	if($('#content_2_1_2').css('z-index')=='10'){
		    		$('#content_2_1_2').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_3').html('');
		    		}
		    	}
		    	if($('#content_2_1_3').css('z-index')=='10'){
		    		$('#content_2_1_3').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_2').html('');
		    		}    		
		    	}
		    });
		    $('#content_2_1_1_1').click();
			}
			
			if(main_new.length>1){
		    $('#content_2_1_1_2').html('<img src="images/dot.png"></img><a href="#">'+main_new[1]['delight_head']+'</a>')
		    .bind('click', function(){
				// 捲動箭頭.
				$("#content_2_3").animate({
					top : '-748px'
				},300, function(){
			    	if($('#content_2_1_2').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','20')
			    		$('#content_2_1_2').css('filter','alpha(opacity=100)')
			    		$('#content_2_1_3').css('z-index','10')
			    		$('#content_2_1_3').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_3').html('');
			    	}else if($('#content_2_1_3').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','10')	    		
			    		$('#content_2_1_2').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_2').html('');    			    		
			    		$('#content_2_1_3').css('z-index','20')
			    		$('#content_2_1_3').css('filter','alpha(opacity=100)')
			    	}
				});
				// 設定現在選項編號.
		    	new_select=1;
		    	if($('#content_2_1_2').css('z-index')=='10'){
		    		$('#content_2_1_2').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_3').html('');
		    		}
		    	}
		    	if($('#content_2_1_3').css('z-index')=='10'){
		    		$('#content_2_1_3').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_2').html('');
		    		}    		
		    	}
		    });
			}
			
			if(main_new.length>2){
		    $('#content_2_1_1_3').html('<img src="images/dot.png"></img><a href="#">'+main_new[2]['delight_head']+'</a>')
		    .bind('click', function(){
				// 捲動箭頭.
				$("#content_2_3").animate({
					top : '-715px'
				},300, function(){
			    	if($('#content_2_1_2').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','20')
			    		$('#content_2_1_2').css('filter','alpha(opacity=100)')
			    		$('#content_2_1_3').css('z-index','10')
			    		$('#content_2_1_3').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_3').html('');
			    	}else if($('#content_2_1_3').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','10')	    		
			    		$('#content_2_1_2').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_2').html('');    			    		
			    		$('#content_2_1_3').css('z-index','20')
			    		$('#content_2_1_3').css('filter','alpha(opacity=100)')
			    	}
				});
				// 設定現在選項編號.
		    	new_select=2;
		    	if($('#content_2_1_2').css('z-index')=='10'){
		    		$('#content_2_1_2').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_3').html('');
		    		}
		    	}
		    	if($('#content_2_1_3').css('z-index')=='10'){
		    		$('#content_2_1_3').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_2').html('');
		    		}    		
		    	}
		    });
			}
			
			if(main_new.length>3){
		    $('#content_2_1_1_4').html('<img src="images/dot.png"></img><a href="#">'+main_new[3]['delight_head']+'</a>')
		    .bind('click', function(){
				// 捲動箭頭.
				$("#content_2_3").animate({
					top : '-682px'
				},300, function(){
			    	if($('#content_2_1_2').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','20')
			    		$('#content_2_1_2').css('filter','alpha(opacity=100)')
			    		$('#content_2_1_3').css('z-index','10')
			    		$('#content_2_1_3').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_3').html('');
			    	}else if($('#content_2_1_3').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','10')	    		
			    		$('#content_2_1_2').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_2').html('');    			    		
			    		$('#content_2_1_3').css('z-index','20')
			    		$('#content_2_1_3').css('filter','alpha(opacity=100)')
			    	}
				});
				// 設定現在選項編號.    	
		    	new_select=3;
		    	if($('#content_2_1_2').css('z-index')=='10'){
		    		$('#content_2_1_2').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_3').html('');
		    		}
		    	}
		    	if($('#content_2_1_3').css('z-index')=='10'){
		    		$('#content_2_1_3').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_2').html('');
		    		}    		
		    	}
		    });
			}
			
			if(main_new.length>4){
		    $('#content_2_1_1_5').html('<img src="images/dot.png"></img><a href="#">'+main_new[4]['delight_head']+'</a>')
		    .bind('click', function(){
				// 捲動箭頭.
				$("#content_2_3").animate({
					top : '-648px'
				},300, function(){
			    	if($('#content_2_1_2').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','20')
			    		$('#content_2_1_2').css('filter','alpha(opacity=100)')
			    		$('#content_2_1_3').css('z-index','10')
			    		$('#content_2_1_3').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_3').html('');
			    	}else if($('#content_2_1_3').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','10')	    		
			    		$('#content_2_1_2').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_2').html('');    			    		
			    		$('#content_2_1_3').css('z-index','20')
			    		$('#content_2_1_3').css('filter','alpha(opacity=100)')
			    	}
				});
				// 設定現在選項編號.    	
		    	new_select=4;
		    	if($('#content_2_1_2').css('z-index')=='10'){
		    		$('#content_2_1_2').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_3').html('');
		    		}
		    	}
		    	if($('#content_2_1_3').css('z-index')=='10'){
		    		$('#content_2_1_3').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_2').html('');
		    		}    		
		    	}
		    });
			}
			
			if(main_new.length>5){
		    $('#content_2_1_1_6').html('<img src="images/dot.png"></img><a href="#">'+main_new[5]['delight_head']+'</a>')
		    .bind('click', function(){
				// 捲動箭頭.
				$("#content_2_3").animate({
					top : '-614px'
				},300, function(){
			    	if($('#content_2_1_2').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','20')
			    		$('#content_2_1_2').css('filter','alpha(opacity=100)')
			    		$('#content_2_1_3').css('z-index','10')
			    		$('#content_2_1_3').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_3').html('');
			    	}else if($('#content_2_1_3').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','10')	    		
			    		$('#content_2_1_2').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_2').html('');    			    		
			    		$('#content_2_1_3').css('z-index','20')
			    		$('#content_2_1_3').css('filter','alpha(opacity=100)')
			    	}
				});
				// 設定現在選項編號.    	
		    	new_select=5;
		    	if($('#content_2_1_2').css('z-index')=='10'){
		    		$('#content_2_1_2').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_3').html('');
		    		}
		    	}
		    	if($('#content_2_1_3').css('z-index')=='10'){
		    		$('#content_2_1_3').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_2').html('');
		    		}    		
		    	}
		    });
			}
			
			if(main_new.length>6){
		    $('#content_2_1_1_7').html('<img src="images/dot.png"></img><a href="#">'+main_new[6]['delight_head']+'</a>')
		    .bind('click', function(){
				// 捲動箭頭.
				$("#content_2_3").animate({
					top : '-580px'
				},300, function(){
			    	if($('#content_2_1_2').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','20')
			    		$('#content_2_1_2').css('filter','alpha(opacity=100)')
			    		$('#content_2_1_3').css('z-index','10')
			    		$('#content_2_1_3').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_3').html('');
			    	}else if($('#content_2_1_3').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','10')	    		
			    		$('#content_2_1_2').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_2').html('');    			    		
			    		$('#content_2_1_3').css('z-index','20')
			    		$('#content_2_1_3').css('filter','alpha(opacity=100)')
			    	}
				});
				// 設定現在選項編號.    	
		    	new_select=6;
		    	if($('#content_2_1_2').css('z-index')=='10'){
		    		$('#content_2_1_2').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_3').html('');
		    		}
		    	}
		    	if($('#content_2_1_3').css('z-index')=='10'){
		    		$('#content_2_1_3').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_2').html('');
		    		}    		
		    	}
		    });                   
			}
			
			if(main_new.length>7){
		    $('#content_2_1_1_8').html('<img src="images/dot.png"></img><a href="#">'+main_new[7]['delight_head']+'</a>')
		    .bind('click', function(){
				// 捲動箭頭.
				$("#content_2_3").animate({
					top : '-546px'
				},300, function(){
			    	if($('#content_2_1_2').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','20')
			    		$('#content_2_1_2').css('filter','alpha(opacity=100)')
			    		$('#content_2_1_3').css('z-index','10')
			    		$('#content_2_1_3').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_3').html('');
			    	}else if($('#content_2_1_3').css('z-index')=='10'){
			    		$('#content_2_1_2').css('z-index','10')	    		
			    		$('#content_2_1_2').css('filter','alpha(opacity=0)')
			    		$('#content_2_1_2').html('');    			    		
			    		$('#content_2_1_3').css('z-index','20')
			    		$('#content_2_1_3').css('filter','alpha(opacity=100)')
			    	}
				});
				// 設定現在選項編號.    	
		    	new_select=7;
		    	if($('#content_2_1_2').css('z-index')=='10'){
		    		$('#content_2_1_2').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_3').html('');
		    		}
		    	}
		    	if($('#content_2_1_3').css('z-index')=='10'){
		    		$('#content_2_1_3').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
		    		// 非ie處理.
		    		if ($.browser.msie){
		    		}else{
		    			$('#content_2_1_2').html('');
		    		}    		
		    	}
		    	
		    });                   
			}
			
		},
		error: function(data){
			alert('失敗!!');
		}
	});	
		
	
	//----------------------------------------------------------------------
	// (外掛)背景遮照.			
	$("#example1").gbxInit({
        left:0,
        width:0          	        
    }); 						
    $("#ex1Act").click(function() {
    	$("#example1").gbxShow();
    	return false;
    });
	$("#closeEx1").click(function() {
		$("#example1").gbxHide();
		return false;
	});
	

    //----------------------------------------------------------------------
	// 函數：關閉開場動畫.
	aaa = function(){
		$('#opening').hide();
		$('#title').show();
		$('#tail').show();
		$('#flashBackground').show();
		
	    // 不含有害化學物質.
	    $('#flashContent').html('<iframe style="z-index:1;" width="815" height="458" frameborder="0" src="delightGuarantee1/delightGuarantee1.html"></iframe>');
	    
	    // 判斷是否開啟廣告.
	    if (new_layer){
	    	// *五重保證廣告.
	    	$("#ex1Act").click();
	    	$("#advertisement_1").css('background','url(picture/TF_index_0610-01.jpg) no-repeat')
	    	.bind('click', function(){
	    		window.open("http://www.delight.com.tw/popup/");
	    	});	    	
	    	// 關閉五重保證廣告.
	    	$("#advertisement_1_close")
	    	.bind('click', function(){
	    		$("#advertisement_1").hide();
	    		$("#advertisement_1_close").hide();	    		
	    		$("#closeEx1").click();
	    	})
	    	.bind('mouseover', function(){
    	      	$('#advertisement_1_close').addClass('hover');
	    	})
	    	.bind('mouseout',function(){
	    	    $('#advertisement_1_close').removeClass();	    		
	    	});
	    
	    	// *最新消息廣告.
	    	$("#advertisement_2").css('background','url(picture/TF_index_0610-01.jpg) no-repeat')
	    	.bind('click', function(){
	    		window.open("http://www.delight.com.tw/popup/");
	    	});	    	
	    	// 關閉五重保證廣告.	    	
	    	$("#advertisement_2_close")
	    	.bind('click', function(){
	    		$("#advertisement_2").hide();
	    		$("#advertisement_2_close").hide();
	    		$("#closeEx1").click();
	    	})
	    	.bind('mouseover', function(){
    	      	$('#advertisement_2_close').addClass('hover');
	    	})
	    	.bind('mouseout',function(){
	    	    $('#advertisement_2_close').removeClass();	    		
	    	});
	    	
	    }else{
	    	$("#advertisement_1").hide();
	    	$("#advertisement_2").hide();
	    }
	}
	
    //----------------------------------------------------------------------
    // 函數：秀現在選項.
    showNowSelect = function(){
      	// 關閉選項.
  		$('#title_1').removeClass();
  		$('#title_2').removeClass();
  		$('#title_3').removeClass();
  		$('#title_4').removeClass();
  		$('#title_5').removeClass();
  		// 顯示選到的選項.                                    	
  		//head = '#title_' + nowSelect;                	
  		//$(head).addClass('hover');

  		// 關閉選項.  		  		
  		$('#title_1_1').hide();  		
  		$('#title_2_1').hide();  		
  		$('#title_3_1').hide();
  		$('#title_4_1').hide();
  		$('#title_5_1').hide();
  		// 顯示選到的選項.                                    	
  		head = '#title_' + nowSelect + '_1';                	
  		$(head).show();  		
  		  		
  		// 關閉內容.
  		$('#content_1_1').hide();  		
  		$('#content_2_1').hide();
  		$('#content_3_1').hide();
  		$('#content_4_1').hide();  		
  		$('#content_5_1').hide();
  		$('#flashBackground').hide();  		  		
  		if(nowSelect==1){
  			$('#flashBackground').show();  			  			
  		}
  		
  		// 開啟選到的內容.
  		head = '#content_' + nowSelect + '_1';
		$(head).show();
  		
    };	
    //----------------------------------------------------------------------
    // 函數：秀紙品常識現在選項.
    showNowSelect4 = function(){
      	// 關閉選項.
  		$('#content_4_1_1').removeClass();
  		$('#content_4_1_2').removeClass();
  		$('#content_4_1_3').removeClass();
  		$('#content_4_1_4').removeClass();
  		$('#content_4_1_5').removeClass();
  		$('#content_4_1_6').removeClass();
  		// 顯示選到的選項.                                    	
  		head = '#content_4_1_' + nowSelect4;                	
  		$(head).addClass('hover');
  		  		
      	// 關閉選項.
  		$('#content_4_1_1_1').hide();
  		$('#content_4_1_2_1').hide();
  		$('#content_4_1_3_1').hide();
  		$('#content_4_1_4_1').hide();
  		$('#content_4_1_5_1').hide();
  		$('#content_4_1_6_1').hide();
  		// 顯示選到的選項.                                    	
  		head = '#content_4_1_' + nowSelect4 + '_1';                	
  		$(head).show();
    };
	    
    //----------------------------------------------------------------------
    // 選項1.                  
	$('#title_1')
    .bind('click', function(){
    	if(nowSelect != 1){
    		nowSelect = 1;
    		showNowSelect();
    		$('#flashContent').html('<iframe style="z-index:1;" width="815" height="458" frameborder="0" src="delightGuarantee1/delightGuarantee1.html"></iframe>');
    	}
    })          		  
    .bind('mouseover', function(){
      if(nowSelect != 1)
    	  $('#title_1').addClass('hover');			          
    })
    .bind('mouseout',function(){
      if(nowSelect != 1)
    	  $('#title_1').removeClass();
    });
    //----------------------------------------------------------------------
    // 選項2.                  
	$('#title_2')
    .bind('click', function(){
    	if(nowSelect != 2){
    		nowSelect = 2;
    		showNowSelect();

			// 判斷是否開啟廣告.    		
    		if (new_layer){
    			$("#ex1Act").click();
    			$("#advertisement_2").show();
    			$("#advertisement_2_close").show();
    		}
    	}    	
    })          		  
    .bind('mouseover', function(){
    	if(nowSelect != 2)
    		$('#title_2').addClass('hover');			          
    })
    .bind('mouseout',function(){
    	if(nowSelect != 2)    	
    		$('#title_2').removeClass();
    });
    //----------------------------------------------------------------------
    // 選項3.                  
	$('#title_3')
    .bind('click', function(){
    	if(nowSelect != 3){
    		nowSelect = 3;
    		showNowSelect();
    	}    	
    })          		  
    .bind('mouseover', function(){
    	if(nowSelect != 3)    	
    		$('#title_3').addClass('hover');			          
    })
    .bind('mouseout',function(){
    	if(nowSelect != 3)    	    	
    		$('#title_3').removeClass();
    });
    //----------------------------------------------------------------------
    // 選項4.                  
	$('#title_4')
    .bind('click', function(){
    	if(nowSelect != 4){
    		nowSelect = 4;
    		showNowSelect();
    	}    	
    })          		  
    .bind('mouseover', function(){
    	if(nowSelect != 4)    	    	
    		$('#title_4').addClass('hover');			          
    })
    .bind('mouseout',function(){
    	if(nowSelect != 4)    	    	    	
    		$('#title_4').removeClass();
    });
    //----------------------------------------------------------------------
    // 選項5.                  
	$('#title_5')
    .bind('click', function(){
    	if(nowSelect != 5){
    		nowSelect = 5;
    		showNowSelect();
    	}    	
    })          		  
    .bind('mouseover', function(){
    	if(nowSelect != 5)    	    	
    		$('#title_5').addClass('hover');			          
    })
    .bind('mouseout',function(){
    	if(nowSelect != 5)    	    	    	
    		$('#title_5').removeClass();
    });

    //----------------------------------------------------------------------	
    // 選項content_3_1_1.                  
	$('#content_3_1_1')
    .bind('click', function(){
        // 開啟Loading視窗.
    	$('#ex1Act').click();
    	$('#content_3_1_1_1').show();
    })          		  	
    .bind('mouseover', function(){
    	$('#content_3_1_1').addClass('hover');
    })
    .bind('mouseout',function(){
   		$('#content_3_1_1').removeClass();
    	//$('#content_3_2_1').hide();
    });
    //----------------------------------------------------------------------	
    // 選項content_3_1_2.                  
	$('#content_3_1_2')
    .bind('click', function(){
        // 開啟Loading視窗.
    	$('#ex1Act').click();
    	$('#content_3_1_1_2').show();  
    })          		  	
    .bind('mouseover', function(){
    	$('#content_3_1_2').addClass('hover');
    })
    .bind('mouseout',function(){
   		$('#content_3_1_2').removeClass();
    	//$('#content_3_2_1').hide();
    });
    //----------------------------------------------------------------------	
    // 選項content_3_1_3.                  
	$('#content_3_1_3')
    .bind('click', function(){
        // 開啟Loading視窗.
    	$('#ex1Act').click();
    	$('#content_3_1_1_3').show();  
    })          		  	
    .bind('mouseover', function(){
    	$('#content_3_1_3').addClass('hover');
    })
    .bind('mouseout',function(){
   		$('#content_3_1_3').removeClass();
    	//$('#content_3_2_1').hide();
    });
	 		
	/*
    //----------------------------------------------------------------------
    // 選項content_3_1_1.                  
	$('#content_3_1_1')
    .bind('mouseover', function(){
    	//$('#content_3_1_1').addClass('hover');
    	$('#content_3_2_1').show();
    	$('#content_3_2_2').hide();
    });
	$('#content_3_2_1')
    .bind('click', function(){
        // 開啟Loading視窗.
    	$('#ex1Act').click();
    	$('#content_3_1_1_1').show();
    })          		  
    .bind('mouseover', function(){
    	//$('#content_3_1_1').addClass('hover');
    	$('#content_3_2_1').show();
    })
    .bind('mouseout',function(){
   		//$('#content_3_1_1').removeClass();
    	$('#content_3_2_1').hide();
    });
	
    //----------------------------------------------------------------------
    // 選項content_3_1_2.                  
	$('#content_3_1_2')
    .bind('mouseover', function(){
    	//$('#content_3_1_2').addClass('hover');
    	$('#content_3_2_2').show();
    	$('#content_3_2_3').hide();
    });
	$('#content_3_2_2')
    .bind('click', function(){
        // 開啟Loading視窗.
    	$('#ex1Act').click();
    	$('#content_3_1_1_2').show();    	
    })          		  
    .bind('mouseover', function(){
    	//$('#content_3_1_2').addClass('hover');
    	$('#content_3_2_2').show();
    })
    .bind('mouseout',function(){
   		//$('#content_3_1_2').removeClass();
    	$('#content_3_2_2').hide();
    });
	
    //----------------------------------------------------------------------
    // 選項content_3_1_3.                  
	$('#content_3_1_3')
    .bind('mouseover', function(){
    	//$('#content_3_1_3').addClass('hover');
    	$('#content_3_2_3').show();
    });
	$('#content_3_2_3')
    .bind('click', function(){
        // 開啟Loading視窗.
    	$('#ex1Act').click();
    	$('#content_3_1_1_3').show();
    })          		  
    .bind('mouseover', function(){
    	//$('#content_3_1_3').addClass('hover');
    	$('#content_3_2_3').show();
    })
    .bind('mouseout',function(){
   		//$('#content_3_1_3').removeClass();
    	$('#content_3_2_3').hide();
    });
	*/
	
    //----------------------------------------------------------------------
    // 選項content_3_1_1_1_1.                  
	$('#content_3_1_1_1_1')
    .bind('click', function(){
	    // 關閉Loading視窗.
	    $('#closeEx1').click();
	    $('#content_3_1_1_1').hide();	    
    })          		  
    .bind('mouseover', function(){
    	$('#content_3_1_1_1_1').addClass('hover');			          
    })
    .bind('mouseout',function(){
   		$('#content_3_1_1_1_1').removeClass();
    });
    //----------------------------------------------------------------------
    // 選項content_3_1_1_1_2.                  
	$('#content_3_1_1_1_2')
    .bind('click', function(){
	    // 關閉Loading視窗.
	    $('#closeEx1').click();
	    $('#content_3_1_1_2').hide();	    
    })          		  
    .bind('mouseover', function(){
    	$('#content_3_1_1_1_2').addClass('hover');			          
    })
    .bind('mouseout',function(){
   		$('#content_3_1_1_1_2').removeClass();
    });
    //----------------------------------------------------------------------
    // 選項content_3_1_1_1_3.                  
	$('#content_3_1_1_1_3')
    .bind('click', function(){
	    // 關閉Loading視窗.
	    $('#closeEx1').click();
	    $('#content_3_1_1_3').hide();	    
    })          		  
    .bind('mouseover', function(){
    	$('#content_3_1_1_1_3').addClass('hover');			          
    })
    .bind('mouseout',function(){
   		$('#content_3_1_1_1_3').removeClass();
    });

    //----------------------------------------------------------------------
    // 選項content_4_1_1.                  
	$('#content_4_1_1')
    .bind('click', function(){
    	if(nowSelect4 != 1){
    		nowSelect4 = 1;
    		showNowSelect4();
    	}
    })          		  
    .bind('mouseover', function(){
    	if(nowSelect4 != 1)    	
    		$('#content_4_1_1').addClass('hover');			          
    })
    .bind('mouseout',function(){
    	if(nowSelect4 != 1)    	
    		$('#content_4_1_1').removeClass();
    });
    //----------------------------------------------------------------------
    // 選項content_4_1_2.                  
	$('#content_4_1_2')
    .bind('click', function(){
    	if(nowSelect4 != 2){
    		nowSelect4 = 2;
    		showNowSelect4();
    	}    	
    })          		  
    .bind('mouseover', function(){
    	if(nowSelect4 != 2)    	
    		$('#content_4_1_2').addClass('hover');			          
    })
    .bind('mouseout',function(){
    	if(nowSelect4 != 2)    	
    		$('#content_4_1_2').removeClass();
    });
    //----------------------------------------------------------------------
    // 選項content_4_1_3.                  
	$('#content_4_1_3')
    .bind('click', function(){
    	if(nowSelect4 != 3){
    		nowSelect4 = 3;
    		showNowSelect4();
    	}    	
    })          		  
    .bind('mouseover', function(){
    	if(nowSelect4 != 3) 	
    		$('#content_4_1_3').addClass('hover');			          
    })
    .bind('mouseout',function(){
    	if(nowSelect4 != 3)    	
    		$('#content_4_1_3').removeClass();
    });
    //----------------------------------------------------------------------
    // 選項content_4_1_4.
	$('#content_4_1_4')
    .bind('click', function(){
    	if(nowSelect4 != 4){
    		nowSelect4 = 4;
    		showNowSelect4();
    	}    	    	
    })          		  
    .bind('mouseover', function(){
    	if(nowSelect4 != 4)
    		$('#content_4_1_4').addClass('hover');			          
    })
    .bind('mouseout',function(){
    	if(nowSelect4 != 4)    	
    		$('#content_4_1_4').removeClass();
    });
    //----------------------------------------------------------------------
    // 選項content_4_1_5.
	$('#content_4_1_5')
    .bind('click', function(){
    	if(nowSelect4 != 5){
    		nowSelect4 = 5;
    		showNowSelect4();
    	}    	    	
    })          		  
    .bind('mouseover', function(){
    	if(nowSelect4 != 5)
    		$('#content_4_1_5').addClass('hover');			          
    })
    .bind('mouseout',function(){
    	if(nowSelect4 != 5)
    		$('#content_4_1_5').removeClass();
    });
    //----------------------------------------------------------------------
    // 選項content_4_1_6.
	$('#content_4_1_6')
    .bind('click', function(){
    	if(nowSelect4 != 6){
    		nowSelect4 = 6;
    		showNowSelect4();
    	}    	    	
    })          		  
    .bind('mouseover', function(){
    	if(nowSelect4 != 6)
    		$('#content_4_1_6').addClass('hover');			          
    })
    .bind('mouseout',function(){
    	if(nowSelect4 != 6)
    		$('#content_4_1_6').removeClass();
    });
	
    //----------------------------------------------------------------------
    // 訂閱電子報.		
	$('#tail_contact')
    .bind('click', function(){
    })          		  
    .bind('mouseover', function(){
   		$('#tail_contact').addClass('hover');			          
    })
    .bind('mouseout',function(){
   		$('#tail_contact').removeClass();
    });

    //----------------------------------------------------------------------
    // 聯絡我們.		
	$('#tail_talk_me')
    .bind('click', function(){
    	
        // 開啟Loading視窗.
    	$('#ex1Act').click();
    	// 開啟聯絡我們視窗.
    	$('#contact_us').show();
    	$('#contact_us_1').show();
    })          		  
    .bind('mouseover', function(){
   		$('#tail_talk_me').addClass('hover');			          
    })
    .bind('mouseout',function(){
   		$('#tail_talk_me').removeClass();
    });
			
    //----------------------------------------------------------------------
    // 關閉聯絡我們.		
	$('#contact_us_1')
    .bind('click', function(){
	    // 關閉Loading視窗.
	    $('#closeEx1').click();    	
    	$('#contact_us').hide();
    	$('#contact_us_1').hide();

    	// 關閉輸入匡訊息.
    	$('.badInputTipContainer').hide();
    	$('.goodInputTipContainer').hide(); 
    })          		  
    .bind('mouseover', function(){
   		$('#contact_us_1').addClass('hover');			          
    })
    .bind('mouseout',function(){
   		$('#contact_us_1').removeClass();
    });
    //----------------------------------------------------------------------
    // 送出聯絡我們.		
	$('#contact_us_2')
    .bind('click', function(){
    	var err=0 ;
    	for(var i=0; i<send_contact_us.length; i++){
    		if(send_contact_us[i]==0){
    			err = 1;
    		}
    	}
    	// 內容也不可以是空白.
    	if($('#contact_textarea').val()==''){
    		err==1;
    	}
    	
    	if(err==1){
    		alert("資料未填齊全!!");
    	}else{    		
        	var datetime = Math.random();    		
        	var name 		= $('#txtFullName').val();
        	var mail 		= $('#txtEmail').val();
        	var tel 		= $('#txtPhone').val();        	
        	var content 	= $('#contact_textarea').val();
    		
        	var queryStr = "{datetime="+datetime+"&tel="+tel+"&name="+name+"&mail="+mail+"&content="+content+"}";
       	  	//var queryStr = "{datetime:'"+datetime+"',tel:'"+tel+"',name:'"+name+"',mail:'"+mail+"',content:'"+content+"'}";
       	  	//alert(queryStr);
       	  	$.ajax({
        		url:"send_mail.php",
          		type:"POST",
          		data:queryStr,
          		cache:false,
          		success:function(jsobj){
          		  alert(jsobj);
          		  
          		  // 清除資料.
              	  for(var i=0; i<send_contact_us.length; i++){
            		send_contact_us[i]=0;
            	  }          		  
          		  $('#txtFullName').val('');
          		  $('#txtEmail').val('');
          		  $('#txtPhone').val('');
               	  $('#contact_textarea').val('');
          	  	},
          	  	error:function(){
                  alert('傳送失敗!!');                  
          	  	},
          	  	dataType:"html"}
       	  	);
   		    $('#contact_us_1').click();
    	}
    })          		  
    .bind('mouseover', function(){
   		$('#contact_us_2').addClass('hover');			          
    })
    .bind('mouseout',function(){
   		$('#contact_us_2').removeClass();
    });
	
	/*
    //----------------------------------------------------------------------
    // 點擊聯絡我們.	
	$('#contact_us_font')
    .bind('click', function(){
        // 開啟Loading視窗.
    	$('#ex1Act').click();
    	// 開啟聯絡我們視窗.
    	$('#contact_us').show();
    	$('#contact_us_1').show();
    });          		  
	*/
	
    //----------------------------------------------------------------------
    // 聯絡我們輸入匡.	    	
    $("#txtFullName").inputTip({
        goodText: "正確!",
        badText: "姓名不可留空!",
        tipText: "請輸入您的姓名!",
        /* Function called to validate the input. It should fire "callback" with the following parameters
        *  First parameter:
        *  - 0: validation failed
        *  - 1: validation succeeded
        *  - 2: show the tip text
        * Second parameter: optional text to display instead of the standard text */
        validateText: function(inputValue, callback) {
            // Checking if the input field contains text.
            if (inputValue.length > 0){
            	send_contact_us[0] = 1;
            	callback(1);
            }else{ 
            	send_contact_us[0] = 0;
            	callback(0);
            }
        },
        // True if the validation should be performed on every key/up event (false by default)
        validateInRealTime: false
    });	
    $("#txtEmail").inputTip({
        goodText: "正確!",
        badText: "E-Mail格式錯誤!",
        tipText: "請輸入您的E-Mail!",
        validateText: function(inputValue, callback) {
            var emailRegexp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
            if (emailRegexp.test(inputValue)){
            	send_contact_us[1] = 1;
            	callback(1);
            }else{ 
            	send_contact_us[1] = 0;
            	callback(0);
            }
        },
        validateInRealTime: false
    });    
    $("#txtPhone").inputTip({
        goodText: "正確!",
        badText: "電話格式錯誤!",
        tipText: "請輸入您的電話!",
        validateText: function(inputValue, callback) {
            var phoneRegexp = /^([0-9-])+$/;
            if (phoneRegexp.test(inputValue)){
            	send_contact_us[2] = 1;
            	callback(1);
            }else{ 
            	send_contact_us[2] = 0;
            	callback(0);
            }
        },
        validateInRealTime: false
    });
	
	//----------------------------------------------------------------------	
    // 選項content_3_1_1_Btn_1(永豐餘商城).                  
	$('#content_3_1_1_Btn_1')
    .bind('click', function(){   
    	//window.open("http://member.yfycpg.com/");
    })          		  	
    .bind('mouseover', function(){
    	$('#content_3_1_1_Btn_1').addClass('hover');
    })
    .bind('mouseout',function(){
   		$('#content_3_1_1_Btn_1').removeClass();
    });
	
    //----------------------------------------------------------------------	
    // 選項content_3_1_1_Btn_2(網路商店).                  
	$('#content_3_1_1_Btn_2')
    .bind('click', function(){
    	// 關閉原本產品說明.
	    $('#content_3_1_1_1').hide();	    
	    // 開啟網路商店.
	    $('#net_buy_1').show();    	
    })          		  	
    .bind('mouseover', function(){
    	$('#content_3_1_1_Btn_2').addClass('hover');
    })
    .bind('mouseout',function(){
   		$('#content_3_1_1_Btn_2').removeClass();
    });
	
    //----------------------------------------------------------------------	
    // 選項content_3_1_2_Btn_1.                  
	$('#content_3_1_2_Btn_1')
    .bind('click', function(){
    	//window.open("http://member.yfycpg.com/");
    })          		  	
    .bind('mouseover', function(){
    	$('#content_3_1_2_Btn_1').addClass('hover');
    })
    .bind('mouseout',function(){
   		$('#content_3_1_2_Btn_1').removeClass();
    });
		
    //----------------------------------------------------------------------	
    // 選項content_3_1_2_Btn_2.                  
	$('#content_3_1_2_Btn_2')
    .bind('click', function(){
    	// 關閉原本產品說明.
    	$('#content_3_1_1_1').hide();
    	$('#content_3_1_1_2').hide();
    	$('#content_3_1_1_3').hide();
	    // 開啟網路商店.
	    $('#net_buy_1').show();
    })          		  	
    .bind('mouseover', function(){
    	$('#content_3_1_2_Btn_2').addClass('hover');
    })
    .bind('mouseout',function(){
   		$('#content_3_1_2_Btn_2').removeClass();
    });
	
    //----------------------------------------------------------------------	
    // 選項content_3_1_3_Btn_1.                  
	$('#content_3_1_3_Btn_1')
    .bind('click', function(){
    	//window.open("http://member.yfycpg.com/");
    })          		  	
    .bind('mouseover', function(){
    	$('#content_3_1_3_Btn_1').addClass('hover');
    })
    .bind('mouseout',function(){
   		$('#content_3_1_3_Btn_1').removeClass();
    });
    //----------------------------------------------------------------------	
    // 選項content_3_1_3_Btn_2.                  
	$('#content_3_1_3_Btn_2')
    .bind('click', function(){
    	// 關閉原本產品說明.
    	$('#content_3_1_1_1').hide();
    	$('#content_3_1_1_2').hide();
    	$('#content_3_1_1_3').hide();
	    
	    // 開啟網路商店.
	    $('#net_buy_1').show();
    })          		  	
    .bind('mouseover', function(){
    	$('#content_3_1_3_Btn_2').addClass('hover');
    })
    .bind('mouseout',function(){
   		$('#content_3_1_3_Btn_2').removeClass();
    });	
	
    //----------------------------------------------------------------------    
    // 網路商店-yahoo.		
	$('#net_buy_2')
    .bind('click', function(){
    	window.open("http://buy.yahoo.com.tw/?catitemid=64909");
    })          		  
    .bind('mouseover', function(){
   		$('#net_buy_2').addClass('hover');			          
    })
    .bind('mouseout',function(){
   		$('#net_buy_2').removeClass();
    });	
    //----------------------------------------------------------------------    
    // 網路商店-pchome.		
	$('#net_buy_3')
    .bind('click', function(){
    	window.open("http://shopping.pchome.com.tw/?mod=store&func=style_show&SR_NO=DAAG0V");
    })          		  
    .bind('mouseover', function(){
   		$('#net_buy_3').addClass('hover');			          
    })
    .bind('mouseout',function(){
   		$('#net_buy_3').removeClass();
    });
    //----------------------------------------------------------------------    
    // 永豐餘商城.		
	$('#net_buy_4')
    .bind('click', function(){    	
    	//window.open("http://ecommerce.yfycpg.com/");
    })          		  
    .bind('mouseover', function(){
   		$('#net_buy_4').addClass('hover');			          
    })
    .bind('mouseout',function(){
   		$('#net_buy_4').removeClass();
    });
    //----------------------------------------------------------------------    
    // x.		
	$('#net_buy_5')
    .bind('click', function(){
	    // 關閉Loading視窗.
	    $('#closeEx1').click();
	    // 關閉網路商店.
	    $('#net_buy_1').hide();    	    	
    })          		  
    .bind('mouseover', function(){
   		$('#net_buy_5').addClass('hover');			          
    })
    .bind('mouseout',function(){
   		$('#net_buy_5').removeClass();
    });

    //----------------------------------------------------------------------    
    // 點logo.
	$('#logo')
    .bind('click', function(){
    	window.location.href = "index.php";
    });          		  	

    //----------------------------------------------------------------------    
    // 另跳視窗.	
	$('#link')
    .bind('click', function(){
    	window.self("http://www.yfycpg.com/");
    });          		  	
		
	
	// 秀現在選項.
	showNowSelect();
  	// 關閉選項.
	$('#title_1').removeClass();
	$('#title_2').removeClass();
	$('#title_3').removeClass();
	$('#title_4').removeClass();
	$('#title_5').removeClass();
	
    // 秀紙品常識現在選項.
    showNowSelect4();
	
    // 關閉產品放大圖.
    $('#content_3_2_1').hide();
    $('#content_3_2_2').hide();
    $('#content_3_2_3').hide();
        
    // 新聞.
    $('#content_2_1_2').html('<iframe width="354" height="330" frameborder="0" src="new.php"></iframe>');
    // 造紙步驟.	
    $('#content_5_1').html('<iframe id="content51" style="z-index:1;" width="815" height="458" frameborder="0" src="delightCreate/delightCreate.html"></iframe>');
    // 不含有害化學物質.
    //$('#flashContent').html('<iframe width="815" height="458" frameborder="0" src="delightGuarantee1/delightGuarantee1.html"></iframe>');
    // 開場動畫.    
    $('#opening').html('<iframe width="850" height="630" frameborder="0" src="delightGuaranteeOpen/delightGuaranteeOpen.html"></iframe>');
    $('#flashBackground').hide();
        
    // 依照不同瀏覽器微調.
    if($.browser.msie){				// 使用IE.
    	// 聯絡我們.
    	$('#contact_textarea').attr('rows','6');
    	$('#contact_textarea').attr('cols','59');
    	$('#contact_us_2').css('top','312px');
    }else if($.browser.mozilla){ 	// 使用FF.
    	var isMac = navigator.userAgent.search("Mac") > -1;
    	// 聯絡我們.
    	$('#contact_textarea').attr('rows','5');    	
    	// 判斷MAC系統.
    	if(isMac){
    		$('#contact_textarea').attr('cols','41');
    	}else{
    		$('#contact_textarea').attr('cols','54');
    	}
    	$('#contact_us_2').css('top','314px');
    }else if($.browser.safari){   	// 使用google、safari.
    	// 聯絡我們.
    	$('#contact_textarea').attr('rows','6');
    	$('#contact_textarea').attr('cols','43');
    	$('#contact_us_2').css('top','316px');
    }else{						  	// 使用google.
    	alert('使用google!!');
    }
        
});
			
// 網頁HTML標籤中引用的圖檔、內嵌物件(如Flash)、IFrame"等拉哩拉雜的東西都載入後才會觸發.
$(window).load(function(){
	//alert("load!!");
});			

