function autoscroll(){
        scrollTo(0,1);
        scrollTo(0,0);
}
function autoscrollby(){
        scrollBy(0,1);
        scrollBy(0,-1);
}

scrollBy(0,-60);
function scrollInit(){
    scrollTo(0,1);
    scrollBy(0,-61);
}

function scrollToTop(){
    height = window.pageYOffset;
    i = 0;
    all_time = 0;
    move_height = 30;
    while( height > 0 && i<10 ){
        i++;
        height = height - move_height;
        all_time = all_time + 40;
        setTimeout(scrollBy,all_time, 0, -1*move_height );
    }
    i++;
    setTimeout(scrollInit,all_time);
}
function scrollToSearchTop(){
    height = window.pageYOffset;
    i = 0;
    all_time = 0;
    move_height = 5;
    while( height < 45 && i<10 ){
        i++;
        height = height + move_height;
        all_time = all_time + 5;
        setTimeout(scrollBy,all_time, 0, move_height );
    }
}


addEventListener("load",function(_1f){
    // first call
    if(!location.href.match('detail')){
      checkSafe();
    }

	setTimeout(autoscrollby,10);
	checkCarrier();
},false);

function checkCarrier(){
    var uName = navigator.userAgent.toLowerCase();
    if(!uName.match('safari')){
    }
}
function pushSearch(){
	key = document.getElementById('kw').value;
	if(key.length > 0){
		return true;
	}else{
		return false;
	}
}
var loading_time=10000;
function loading(position){
    spinner = document.getElementById('spinner');
    spinner.innerHTML = '<p><img src="'+url_root + '/images/loading.gif" align="absmiddle" /></p>';
    spinner.style.top = position + 'px';
    //spinner.style.top = '100px';
    spinner.style.display = 'block';
    setTimeout(hideSpinner,loading_time);
}
function hideSpinner(){
    spinner = document.getElementById('spinner');
    spinner.style.display = 'none';
}
