﻿function showsubmenu($sid){
    var temp=document.getElementById($sid);	
    if (temp.style.display == 'none'){
		document.cookie = "lastmenu=" + escape($sid); 
        temp.style.display='block';
    }
    else{
		document.cookie = "lastmenu=" + escape('') ;
        temp.style.display='none';
    }
}
function showimg(many,url1,url2,url3,pname){
	//return TB_show(pname,url1)
	if (many==1){
		var newarray=new Array();
		if (url1.length>5){
			newarray[0]=url1;
		}
		if (url2.length>5){
			newarray[1]=url2;
		}
		if (url3.length>5){
			newarray[2]=url3;
		}
		return TB_show2(pname,url1,newarray);
	} 	
	else{
		return TB_show(pname,url1)
	}
}
function op(url,urlid){
window.open(url,urlid,"width=400,height=360,scrollbars=no")
}

function displayList(count){
	window.clearInterval(tt);
	var h = document.getElementById("pic_rap").scrollTop;
	var max_h = (count-1)*(354+2);
	var anim = function(){
		if (h<max_h){
			if(document.getElementById("pic_rap").scrollTop >= max_h){
				document.getElementById("pic_rap").scrollTop= max_h
				if(tt){window.clearInterval(tt);}
			}
			else{
				document.getElementById("pic_rap").scrollTop += 15;
			}
		}
		else{
			if(document.getElementById("pic_rap").scrollTop <= max_h){
				document.getElementById("pic_rap").scrollTop= max_h
				if(tt){window.clearInterval(tt);}
			}
			else{
				document.getElementById("pic_rap").scrollTop -= 15;
			}
		}
	}
	tt = window.setInterval(anim,2);
}

function sroll_init(){
	 $("#button a").mouseover(function(){
		displayList($(this).text());
		$("#button a").removeClass("current");
		$(this).addClass("current");
	})
}

function sroll(){
	if (stopscroll==false){
		i++;
		if (i>3){
			i=1
		}
		$("#button a").removeClass("current");
		$("#button a:eq("+(i-1)+")").addClass("current");
		displayList(i);
	}
}