// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults


try{
	var url = window.location.href;
	if (url.indexOf('50f7.com')>0){
		if ( url.indexOf('.html')>0 ){
			window.location = 'http://50f7.com/blog'
		}
	}	
}
catch(e) { }


function onSearch(input){
	s = document.getElementById("searchoptions");
	v = input.value;
	text='';	
	for (i = 0; i <= list.length-1; i++){
		if( list[i][1].indexOf(v)>=0 ){
		 	text += "<a href="+list[i][0]+">"+list[i][1]+"</li><br/>"
		 }
	}
	s.innerHTML = text;
}

function viewmore(){
	target = document.getElementById("prepare_allarea");
	if (target.innerHTML==''){
		target.innerHTML = (document.getElementById("allarea").innerHTML);
	}else{
		target.innerHTML = '';
	}
}
//name div的名字,total共有多少个div,start开始切换的序号,delay间隔
function list_next_div(){
    current_div = document.getElementById(name+(start));
    if ( current_div==null ){ return; }
    hidden_div = document.getElementById(name+(start-1));
    show_div = document.getElementById(name+start);
    if ( hidden_div!=null ){ hidden_div.style.display = "none"; }
    if ( show_div!=null ){ show_div.style.display = "block";}
    if ( show_div==null ){ start=1; list_next_div(); } else { start++; }
}