var SORT='default';var PAGE=1;var IMAGE_URL='image/';var GAME_LIST_TIMEOUT=0;var VOTE_TIMEOUT=0;$(document).ready(function(){var ol_glist=new OL_GameList('#game-list ul','#game-type','#user-list','#user-view-list');var ol_search=new OL_Search('#search-input','#game-type','#game-lang','.search-icon','#user-list');var ol_detail=new OL_Detail('#img-left','#img-right','#game-type','#game-name');var ol_numrom=new OL_NumRom('#sumrom','#percentBar');var ol_utube=new OL_YouTube('#game-video','#game-video-contain','#game-img','#game-type','#video-keyword');var ol_pages=new OL_Pages('#game-pages');var ol_tips=new OL_Tips('#game-tips');var ol_url_manage=new OL_URL_Manage();var ol_cookie=new OL_Cookie();if(isIE||isSafari||isOpera){ol_tips.setDefaultTips('firefox',['<a href="http://www.mozilla.com/firefox/" ','style="color:#F1872F;" target="_blank" >','Download Firefox','</a>'].join(''),1000)}else{ol_tips.setDefaultTips('onlinelist',['<a href="http://chokba.kmitl.net/onlinelist.v.2.2a/" ','style="color:#999;" target="_blank" >','Use Old Version','</a>'].join(''),1000)}$('html').keyup(function(e){if(!$('#search-input').hasClass('search-focus')&&$('.glist-selected').size()!=0){var key=e.charCode||e.keyCode||0;if(key==38){$('.glist-selected').prev().find('.warp-list').click()}else if(key==40){$('.glist-selected').next().find('.warp-list').click()}}});$('#game-type > div').click(function(){var type=$(this).attr('title');$('#game-type').data('type',type);$('#game-type > div').each(function(){var $div=$(this).find('.games-icon');var t=$(this).attr('title');if($div.hasClass(t+'-image')){$div.removeClass(t+'-image').addClass(t+'-image-dark')}});$(this).find('.games-icon').removeClass(type+'-image-dark').addClass(type+'-image');$('#search-input').val('');ol_search.search();$(this).addClass('select-type').siblings().removeClass('select-type')});$('#game-lang div').click(function(){var lang=$(this).attr('lang');$('#game-lang').data('lang',lang);PAGE=1;ol_search.search();$(this).addClass('lang-hilight').siblings().removeClass('lang-hilight')});(function($ele){var ary=[];$ele.find('a.sort-list').each(function(){ary.push({'title':$(this).html(),'value':$(this).attr('value')})});$ele.data('list',ary);$ele.html(['<a href="#" value="',$ele.find('a:first').attr('value'),'" class="',$ele.find('a:first').attr('class'),'" >',$ele.find('a:first').html(),'</a>'].join(''));$ele.click(function(){if($('#sort-select').size()==0){var offset=$ele.offset();var list=[];$.each($ele.data('list'),function(i){list.push(['<li sort="',this.value,'" >',this.title,'</li>'].join(''))});$('body').append(['<ul id="sort-select" ','style="top:',offset.top+$ele.outerHeight()-1,'px; left:',offset.left,'px;" >',list.join(''),'</ul>'].join(''))}else{$('#sort-select').remove()}});$("#sort-select li").live('click',function(){SORT=$(this).attr('sort');$ele.html(['<a href="#" value="',SORT,'" >',$(this).html(),'</a>'].join(''));$('#sort-select').remove();PAGE=1;ol_search.search()})})($('#game-sort'));ol_search.beforeSearch(function(){ol_tips.showTips('waiting','Searching ...')});ol_search.onSearchComplete(function(json_glist){ol_glist.showList(json_glist);ol_numrom.showSumRom(json_glist.count,json_glist.total);ol_pages.showPages(json_glist.count,json_glist.total);ol_tips.setText('Complete !!');ol_tips.closeTips(1000)});ol_pages.onClickPages(function(ele){PAGE=$(ele).attr('name');ol_search.search()});ol_glist.onClickList(function($li){ol_tips.showTips('waiting','Loading ...');ol_utube.$img.show();ol_utube.$contain.hide();ol_detail.setImage($li.attr('img'));ol_detail.setTitle($li.attr('name'));ol_detail.getDetail($li.attr('romId'),function(html){$li.append(['<div class="ol-gDetail">',html,'</div>'].join('')).ready(function(){new OL_Vote($li)});ol_tips.setText('Complete !!');ol_tips.closeTips(1000)});if($li.attr('name')!='Not Found'){ol_utube.loadVideo($li.attr('name'))}ol_url_manage.setType($('#game-type').data('type'));ol_url_manage.setKeyword($li.attr('name'));ol_url_manage.updateURL()});ol_glist.onClickRemoveList(function(){ol_search.search();$('.user-list-sum').html(parseInt($('.user-list-sum').html())-1)});$('#video-keyword').toggle(function(){var keyword=$(this).data('keyword');var offset_video=$('#game-video').offset();var h=$('#game-video').innerHeight()-35;$('body').append(['<div class="wrap-input-video-keyword corner3px" ','style="top:',offset_video.top+h,'px; left:',offset_video.left-2,'px;">','<input id="input-video-keyword" type="text" size="40" maxlength="100" />','<div id="input-video-keyword-button" ></div>','</div>'].join('')).ready(function(){$('#input-video-keyword').val(keyword);$('#input-video-keyword').keyup(function(e){var key=e.charCode||e.keyCode||0;if(key==13){ol_utube.loadVideo($(this).val())}});$('#input-video-keyword-button').click(function(){ol_utube.loadVideo($('#input-video-keyword').val())})})},function(){$('.wrap-input-video-keyword').remove()});$('#search-input').focus(function(){$(this).addClass('search-focus')}).blur(function(){$(this).removeClass('search-focus')}).focus();$('.login-input-small').focus(function(){if($(this).attr('title')==$(this).val()){$(this).addClass('login-focus');$(this).val('')}}).blur(function(){if($(this).attr('title')==$(this).val()||$(this).val()==''){$(this).removeClass('login-focus');$(this).val($(this).attr('title'))}});ol_url_manage.setupConfig(function(config){$('#game-type').data('type',config[0]);$('div[title="'+config[0]+'"]',$('#game-type')).addClass('select-type').find('.games-icon').removeClass(config[0]+'-image-dark').addClass(config[0]+'-image').parent().siblings().removeClass('select-type');$('#game-lang').data('lang','all');$('.lang-all').addClass('lang-hilight').siblings().removeClass('lang-hilight');if(ol_url_manage.haveCookie()&&!ol_url_manage.haveSpecialParameter()){var lang_config='';var sort_config='';if(ol_url_manage.getMode()=='normal_mode'){lang_config=ol_cookie.get('index_lang');sort_config=ol_cookie.get('index_sort')}else{lang_config=ol_cookie.get('user_lang');sort_config=ol_cookie.get('user_sort')}if(!lang_config||lang_config=='undefinded'){lang_config='all'}if(!sort_config||sort_config=='undefinded'){sort_config='default'}$('#game-lang').data('lang',lang_config);$('.lang-'+lang_config).addClass('lang-hilight').siblings().removeClass('lang-hilight');SORT=sort_config;$.each($('#game-sort').data('list'),function(){if(this.value==sort_config){$('#game-sort').html(['<a href="#" value="',this.value,'" >',this.title,'</a>'].join(''))}})}$('#search-input').val(config[1]);ol_search.search()})});var OL_GameList=function(ele,ele_type,ele_user_list,ele_user_view_list){this.$ele=$(ele);this.$type=$(ele_type);this.$user_list=$(ele_user_list);this.user_view_own_list='false';this.start_index=0;if($(ele_user_view_list).val()=='true'){this.user_view_own_list='true'}this.clickListFunc=function(ele){};this.clickRemoveListFunc=function(ele){}};OL_GameList.prototype.setStartIndex=function(index){this.start_index=index-1};OL_GameList.prototype.onClickList=function(func){this.clickListFunc=func};OL_GameList.prototype.onClickRemoveList=function(func){this.clickRemoveListFunc=func};OL_GameList.prototype.showList=function(json_gameData){var glist=[];var list=json_gameData.gamelist;var keyword=json_gameData.keyword;if(!list){list=[{'id':'not found','title':'Not Found','img':'not found','romId':'Not Found','keyword':'not found','score':0,'vote_count':0}]}var self=this;$.each(list,function(i,gli){var li=new OL_List(gli,keyword,self.user_view_own_list);glist.push(li.getList())});var self=this;this.$ele.html(glist.join('')).ready(function(){$(this).find('.warp-list').click(function(){var $li=$(this).parent();$li.addClass('glist-selected').siblings().removeClass('glist-selected');$('.ol-gDetail').remove();clearInterval(GAME_LIST_TIMEOUT);GAME_LIST_TIMEOUT=setTimeout(function(){$('.ol-gDetail').remove();self.clickListFunc($li)},500)});$(this).find('.remove-game-button').click(function(){$li=$(this).parent().parent().parent();if($li.attr('romId')!='not found'){$.post('php/removeVote.php',{'id':$li.attr('romId'),'type':self.$type.data('type'),'user_name':self.$user_list.val()},function(){self.clickRemoveListFunc()})}});$(this).find('.warp-list:eq('+self.start_index+')').click();self.start_index=0})};var OL_List=function(gli,key,user_view_own_list){this.id=gli.id;this.name=gli.title;this.img=gli.img;this.romId=gli.romId;this.location=gli.location;this.score=gli.score;this.vote_count=gli.vote_count;this.user_have=gli.user_have;this.view_own_list=user_view_own_list;this.keyword=$.trim(key)};OL_List.prototype.getList=function(){var listname='';if(this.name.length>40)listname=this.name.substring(0,40);else listname=this.name;if(this.score%1==0){this.score=parseInt(this.score)}else{var dotIndex=this.score.indexOf('.');this.score=this.score.substring(0,dotIndex+2)}var dark='';if(this.score==0){dark='-dark'}listname=this.highlightName(listname);var option='';if(this.view_own_list=='true'){option='<div class="option-game-list"><div class="remove-game-button" title="remove form list" ></div></div>'}else if(this.user_have){option='<div class="option-game-list"><div class="user-have-game" title="This game is already exist in YourOnlinelist" ></div></div>'}if(this.romId&&this.romId.length<4){for(var i=0;i<4-this.romId.length;i++){this.romId=['0',this.romId].join('')}}var li=['<li class="ol-glist" img="',this.img,'" romId="',this.id,'" name="',this.name,'">','<div class="warp-list">','<div class="flag-game flag-',this.location,'"></div>','<div style="width:329px; float:left; height:20px; margin-left:5px; overflow:hidden;">','<a href="#">',this.romId,' - ',listname,'</a>','</div>','</div>','<div class="short-detail">',option,'<div class="short-score score-icon',dark,'">',this.score,'</div>','</div>','</li>'];return li.join('')};OL_List.prototype.highlightName=function(listname){if(this.keyword!=''){var kTmp=this.keyword.toLowerCase();var lTmp=listname.toLowerCase();var kArray=[];if(kTmp.indexOf(' ')==-1){kArray[0]=kTmp}else{kArray=kTmp.split(' ')}$.each(kArray,function(i,key){if(key!=' '||key!=''){var iKey=lTmp.indexOf(key);while(iKey!=-1){listname=listname.substring(0,iKey)+'<b>'+listname.substring(iKey,iKey+key.length)+'</b>'+listname.substring(iKey+key.length,listname.length);lTmp=listname.toLowerCase();iKey=lTmp.indexOf(key,iKey+key.length+7)}}})}return listname};var OL_Detail=function(ele_img1,ele_img2,ele_type,ele_title){this.$img1=$(ele_img1);this.$img2=$(ele_img2);this.$type=$(ele_type);this.$title=$(ele_title)};OL_Detail.prototype.setTitle=function(name){this.$title.html(name)};OL_Detail.prototype.setImage=function(img_num){if(img_num=='not found'){var img1='<img src="css/image/notfound.gif" />';var img2='<img src="css/image/notfound.gif" />'}else{var start_folder=Math.floor(img_num/500)*500;var folder=[this.$type.data('type'),'/',(start_folder+1),'-',(start_folder+500),'/'].join('');var type=this.$type.data('type');var list_type=Array('gb','gbc','gba','nes','md','n64');var list_type_1_2=Array('nds','psp','ps3','wii','xbox360','snes');var size='m-';var css=[];if(jQuery.inArray(type,list_type)!=-1){css[0]=size+'img-'+type;css[1]=size+'img-'+type}else{css[0]=size+'img-'+type+'1';css[1]=size+'img-'+type+'2'}var img1=['<img class="',css[0],'" src="',IMAGE_URL,folder,img_num,'a.png" />'].join('');var img2=['<img class="',css[1],'" src="',IMAGE_URL,folder,img_num,'b.png" />'].join('')}this.$img1.html(img1);this.$img2.html(img2)};OL_Detail.prototype.getDetail=function(id,func){$.post('php/OL_getDetail.php',{'id':id,'type':this.$type.data('type')},function(json){if(!(json.language||json.rom_size||json.publisher)){json.language='not found';json.rom_size='not found';json.publisher='not found'}if(json.language.length>70){json.language=json.language.substring(0,70);json.language=json.language.substring(0,json.language.lastIndexOf('-'))}if(json.publisher==''){json.publisher='???'}if(json.language==''){json.language='???'}if(json.rom_size==0){json.rom_size='???'}var list_score=[];for(var i=1;i<=10;i++){var check='';if(i==parseInt(Math.round(json.score))){check='checked="checked"'}list_score.push('<input name="game-score" type="radio" value="'+i+'" class="score" '+check+' />')}var detail=['<table border="0" cellspacing="0">','<tr>','<td class="detail-header" style="border-bottom:1px solid #CCC;" >score</td>','<td style="border-bottom:1px solid #CCC;">','<div class="game-score">',list_score.join(''),'</div>','<div class="how-to-vote">(click star to vote)</div>','<div class="game-score-count">votes: ',json.vote_count,'</div>','</td>','</tr>','<tr>','<td class="detail-header">publisher</td>','<td>',json.publisher,'</td>','<tr>','<td class="detail-header">rom-size</td>','<td>',json.rom_size,'</td>','</tr>','<tr valign="top">','<td class="detail-header">language</td>','<td>',json.language,'</td>','</tr>','</table>'].join('');func(detail)},'json')};var OL_NumRom=function(ele_numrom,ele_percentbar){this.$num=$(ele_numrom);this.$pBar=$(ele_percentbar);this.$pBar.html('<div class="pBar-color" style="height:5px; width:0px;">&nbsp;</div>')};OL_NumRom.prototype.setGraph=function(num,max){var p=Math.ceil((num/max)*this.$pBar.width());this.$pBar.find('.pBar-color').stop().animate({'width':p},'slow')};OL_NumRom.prototype.showSumRom=function(num,max){this.setGraph(num,max);this.$num.html(['results: ',num,'/',max].join(''))};var OL_Search=function(ele,ele_type,ele_lang,ele_button,ele_user_list){this.$ele=$(ele);this.$type=$(ele_type);this.$lang=$(ele_lang);this.$button=$(ele_button);this.onCompleteFunc=function(){};this.beforeSearchFunc=function(){};this.user_list=$(ele_user_list).val();var self=this;$(ele).keyup(function(e){var key=e.charCode||e.keyCode||0;if(key==13){self.search();PAGE=1}});$(ele_button).click(function(){self.search();PAGE=1})};OL_Search.prototype.onSearchComplete=function(func){this.onCompleteFunc=func};OL_Search.prototype.beforeSearch=function(func){this.beforeSearchFunc=func};OL_Search.prototype.search=function(){this.beforeSearchFunc();var self=this;$.post('php/OL_getGameList.php',{'search':this.$ele.val(),'type':this.$type.data('type'),'lang':this.$lang.data('lang'),'sort':SORT,'page':PAGE,'user_list':this.user_list},function(json){self.onCompleteFunc(json)},'json')};var OL_YouTube=function(ele,ele_contain,ele_img,ele_type,ele_keyword){this.$ele=$(ele);this.$type=$(ele_type);this.$img=$(ele_img);this.$contain=$(ele_contain);this.$keyword=$(ele_keyword);this.$contain.addClass('show-video-contain').hide();var self=this;$('.resultDiv_gsvb img').live('click',function(){self.$img.hide();self.$contain.show()});$('.alldone_gsvb').live('click',function(){self.$img.show();self.$contain.hide()})};OL_YouTube.prototype.shearKeyword=function(keyword){var type=this.$type.data('type');var t1=keyword.indexOf('(');if(t1!=-1){keyword=keyword.substring(0,t1)}if(type=='nds'){if(keyword.indexOf('DS')!=-1)type=''}return keyword};OL_YouTube.prototype.loadVideo=function(keyword){var videoBar=new GSvideoBar(this.$ele.get(0),this.$contain.get(0),{largeResultSet:false,string_allDone:'<img src="css/image/video-close-2.gif" height="14" title="close" />',horizontal:true});keyword=this.shearKeyword(keyword);this.$keyword.data('keyword',keyword);$('#input-video-keyword').val(keyword);videoBar.execute(this.$type.data('type')+' '+keyword)};var OL_Pages=setEle=function(ele){this.$ele=$(ele);this.pagesClick=function(ele_page){};this.sumPage=0;var self=this;this.$ele.find('a').live('click',function(){self.pagesClick(this)})};OL_Pages.prototype.onClickPages=function(func){this.pagesClick=func};OL_Pages.prototype.showPages=function(count,max){this.sumPage=Math.ceil(count/15);if(PAGE>0){this.updatePages()}};OL_Pages.prototype.updatePages=function(){var nowPage=parseInt(PAGE);var pages=[];if(this.sumPage<7){for(var i=1;i<=7&&i<=this.sumPage;i++){var c="";if(i==nowPage){c='class="pages-select"'}pages.push(['<a href="#" name="',i,'" ',c,' >',i,'</a>'].join(''))}}else{if(nowPage>4){pages.push(['<a href="#" name="',(nowPage-1),'" class="pages-select-txt" >Previous</a>'].join(''));for(var i=nowPage-3;(i<=nowPage+3)&&(i<=this.sumPage);i++){var c="";if(i==nowPage){c='class="pages-select"'}pages.push(['<a href="#" name="',i,'" ',c,' >',i,'</a>'].join(''))}if(nowPage+3<this.sumPage){pages.push('<span> ... </span>')}}else{for(var i=1;i<=7;i++){var c="";if(i==nowPage){c='class="pages-select"'}pages.push(['<a href="#" name="',i,'" ',c,' >',i,'</a>'].join(''))}pages.push('<span> ... </span>')}}if(this.sumPage>1){if(this.sumPage==nowPage){pages.push(['<a href="#" name="',nowPage,'" class="pages-select-txt" >Next</a>'].join(''))}else{pages.push(['<a href="#" name="',(nowPage+1),'" class="pages-select-txt" >Next</a>'].join(''))}}this.$ele.html(pages.join(''))};var OL_Tips=function(ele){this.$ele=$(ele);this.status='';this.text='';this.delay=1000;this.$ele.prepend('<img src="" width="24" height="24" align="left" />').hide()};OL_Tips.prototype.setDefaultTips=function(status,txt,delay){if(delay){this.delay=delay}this.status=status;this.text=txt;this.showTips(this.status,this.text)};OL_Tips.prototype.showDefaultTips=function(){this.setStatus(this.status);this.setText(this.text);this.$ele.fadeIn(this.delay)};OL_Tips.prototype.showTips=function(status,txt){this.setStatus(status);this.setText(txt);this.$ele.show()};OL_Tips.prototype.closeTips=function(delay){if(!delay){delay=1000}var self=this;this.$ele.fadeOut(delay);setTimeout(function(){self.showDefaultTips()},delay+1000)};OL_Tips.prototype.setStatus=function(status){this.$ele.removeClass().attr('class','tips-txt corner3px');if(status=='tips'){this.$ele.addClass('tips-tips');this.$ele.find('img').attr('src','css/image/tip3.gif')}else if(status=='waiting'){this.$ele.addClass('tips-waiting');this.$ele.find('img').attr('src','css/image/process.gif')}else if(status=='warning'){this.$ele.addClass('tips-warning');this.$ele.find('img').attr('src','css/image/warning3.gif')}else{this.$ele.addClass('tips-'+status);this.$ele.find('img').attr('src','css/image/'+status+'.gif')}};OL_Tips.prototype.setText=function(txt){this.$ele.find('div:eq(0)').html(txt)};var OL_Vote=function($ele){this.$ele=$ele;this.init()};OL_Vote.prototype.init=function(){var self=this;this.$ele.find('.score').rating({'callback':function(val){self.addVote(val)}})};OL_Vote.prototype.addVote=function(score){var self=this;if(this.$ele.attr('romId')!='not found'){$.post('php/addVote.php',{'score':score,'rom_id':this.$ele.attr('romId'),'type':$('#game-type').data('type')},function(json){var now_score=json.avg;var vote_count=json.vote_count;if(json.cant_vote){alert('Sorry... You can vote this game, in next Month')}else if(json.not_user){alert('Please Login to vote')}else{self.makeVote(now_score,vote_count)}},'json')}};OL_Vote.prototype.makeVote=function(score,vote_count){var list_score=[];for(var i=1;i<=10;i++){var check='';if(i==parseInt(Math.round(score))){check='checked="checked"'}list_score.push('<input name="game-score" type="radio" value="'+i+'" class="score" '+check+' />')}if(score%1==0){score=parseInt(score)}else{var dotIndex=score.indexOf('.');score=score.substring(0,dotIndex+2)}var self=this;this.$ele.find('.short-score').removeClass('score-icon-dark').addClass('score-icon').html(score);if(this.$ele.find('.option-game-list').size()==0){this.$ele.find('.short-detail').prepend(['<div class="option-game-list">','<div class="user-have-game" title="This game is already exist in YourOnlinelist" >','</div>','</div>'].join(''))}this.$ele.find('.game-score-count').html('votes: '+vote_count);this.$ele.find('.game-score').html(list_score.join('')).ready(function(){self.init()})};var OL_Cookie=function(){this.EXPIREDAYS=365*5};OL_Cookie.prototype.set=function(name,value){var exdate=new Date();var expiredays=this.EXPIREDAYS;exdate.setDate(exdate.getDate()+expiredays);document.cookie=name+"="+escape(value)+((expiredays==null)?"":";expires="+exdate.toGMTString())};OL_Cookie.prototype.get=function(name){if(document.cookie.length>0){var start=document.cookie.indexOf(name+"=");if(start!=-1){start=start+name.length+1;var end=document.cookie.indexOf(";",start);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(start,end))}}return''};OL_Cookie.prototype.remove=function(name){if(this.get(name)){document.cookie=name+"="+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}};var OL_URL_Manage=function(){this.DEFAULT_TYPE='nds';this.DEFAULT_LANG='all';this.DEFAULT_SORT='default';this.DEFAULT_PAGE=1;this.DEFAULT_INDEX=1;this.DEFAULT_KEYWORD='';this.location=document.location+'';this.DEFAULT_URL=this.getRealURL();this.cookie=new OL_Cookie();this.URL_paramter=[]};OL_URL_Manage.prototype.haveSpecialParameter=function(){if(this.location.indexOf('#')!=-1){return true}return false};OL_URL_Manage.prototype.haveCookie=function(){if(this.getMode()=='normal_mode'&&this.cookie.get('index_type')){return true}if(this.getMode()=='user_mode'&&this.cookie.get('user_type')){return true}return false};OL_URL_Manage.prototype.getMode=function(){if(this.location.indexOf('?user=')!=-1&&$('#user-view-list').val()=='true'){return'user_mode'}return'normal_mode'};OL_URL_Manage.prototype.updateURL=function(){document.location=[this.DEFAULT_URL,'#',this.URL_parameter[0],'/',this.URL_parameter[1],].join('');if(this.getMode()=='normal_mode'){this.cookie.set('index_type',this.URL_parameter[0]);this.cookie.set('index_keyword',$('#search-input').val());this.cookie.set('index_lang',$('#game-lang').data('lang'));this.cookie.set('index_sort',SORT)}else if(this.getMode()=='user_mode'){this.cookie.set('user_type',this.URL_parameter[0]);this.cookie.set('user_keyword',$('#search-input').val());this.cookie.set('user_lang',$('#game-lang').data('lang'));this.cookie.set('user_sort',SORT)}};OL_URL_Manage.prototype.setKeyword=function(keyword){this.URL_parameter[1]='';};OL_URL_Manage.prototype.setType=function(type){this.URL_parameter[0]=type};OL_URL_Manage.prototype.setLang=function(lang){this.URL_parameter[2]=lang};OL_URL_Manage.prototype.setSort=function(sortBy){this.URL_parameter[3]=sortBy};OL_URL_Manage.prototype.setPage=function(page){this.URL_parameter[4]=page};OL_URL_Manage.prototype.setIndex=function(index){this.URL_parameter[5]=index};OL_URL_Manage.prototype.getRealURL=function(){var tmp_loc=document.location+'';if(tmp_loc.indexOf('#')!=-1){tmp_loc=tmp_loc.substring(0,tmp_loc.indexOf('#'))}return tmp_loc};OL_URL_Manage.prototype.setupConfig=function(func){var config=[];if(this.haveSpecialParameter()){var tmp_loc=document.location+'';if(tmp_loc.indexOf('#')!=-1){var start=tmp_loc.indexOf('#')+1;var finish=tmp_loc.indexOf('/',start);while(finish!=-1){config.push(tmp_loc.substring(start,finish));start=finish+1;finish=tmp_loc.indexOf('/',start)}if(start!=tmp_loc.length){config.push(tmp_loc.substring(start,tmp_loc.length))}}}else if(this.haveCookie()){if(this.getMode()=='normal_mode'){config[0]=this.cookie.get('index_type');config[1]=this.cookie.get('index_keyword')}else if(this.getMode()=='user_mode'){config[0]=this.cookie.get('user_type');config[1]=this.cookie.get('user_keyword')}}for(var i=config.length;i<2;i++){config[i]=''}var self=this;$.each(config,function(i){if(this==''){if(i==0){config[i]=self.DEFAULT_TYPE};if(i==1){config[i]=self.DEFAULT_KEYWORD}}});config[1]=config[1].replace(/_/g,' ');this.URL_parameter=config;func(config)};