          
          var firstOprionList = new Array();
          var secondOptionList = new Array();
          
        	//設定父選項裡的內容
        	function setFirstOption(){
        	   
            //
            $("#firstOption").append('<option value="' + 0 + '" selected>' + '-----遊戲類別-----' + '</option>');
        	  
        	  //
            var __len = firstOprionList.length;
            for(var i=1;i<=__len;i++){
              $("#firstOption").append('<option value="' + i + '">' + firstOprionList[i-1] + '</option>');
            }
            $("#secondOption").append('<option value="empty">-----遊戲名稱-----</option>');
            //hack for ie7
            $('#firstOption').css('width',$('#firstOption').css('width'));
          }
          
          //
        	function commonTemplate(item) {
        		return '<option value="' + item.value + '">' + item.text + '</option>'; 
        	};
        	
        	//
        	function commonMatch(selectedValue) {
        		return this.index == selectedValue; 
        	};
        	
        	//
        	function search(e){
            //alert('value = ' + e.type);
            //window.open ('http://tw.yahoo.com', 'newwindow', 'height=50, width=50, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no');
            var __category = $("#firstOption").val();
            var __url = $("#secondOption").val();
            
            
            if(__category == 0){
              alert("請選擇遊戲分類");
            }else if(__url == null){
              alert("請先選擇遊戲分類");
            }else{
              window.open (__url, '_blank');
            }
            
          }
        	
          
          $(document).ready(function()
        	{
            var __index=0;
            //secondOptionList.push({index:__index,Value:"",Text:"------------",image:"",link:""});
            
            
        	   //遊戲分類
        	  $(".game-category").filter(function(index) {
        	     
        	     //取得分類
        	     //var __gameCategory = $(this).html();
        	     
        	     
               //取得分類的名稱
               var __title = $('.game-category-title',this).text();
               
               __index++;
               
               //取得 分類選項
               firstOprionList.push(__title);
               
               
               //取得分類選項 下的 遊戲選項
               var __gameItem = $('.game-item',this);
               $.each(__gameItem, function(i, n){
                  //alert( "Item #" + i + ": " + n);
                  
                  //var __imgSrc = $('.game-image',this).attr('src');
                  var __link = $('.game-title > a',this).attr('href');
                  var __gameName = $('.game-title > a',this).text();
                  
                  //secondOptionList.push({index:__index,Value:__link,Text:__gameName,image:__imgSrc,link:__link});
                  secondOptionList.push({index:__index,value:__link,text:__gameName});
                  
              });
              
            }); 
        	   
        	   //設定父選項內容
        	   setFirstOption();
        	   
            //設定 cascade
        		$("#secondOption").cascade("#firstOption",{	
        			list: secondOptionList,			
        			template: commonTemplate,
        			match: commonMatch 			
        		});
            
        	});