// JavaScript Document

function OverYaer() {
oli = $("#history .history-year li p span");
oli.click(function(){
th = $(this);
for (i=0; i<oli.length; i++) {
if (oli.eq(i).attr("id")!=th.attr("id")) {
oli.eq(i).parent().prev().fadeOut(600);
}
else {
$("#history div.content").hide();
$("#"+th.attr("id")+"-block").show();
oli.eq(i).parent().prev().fadeIn(600);
}
}
oli.removeClass("year-a").addClass("year-d");
th.removeClass("year-d").addClass("year-a");
});
}

function tooltip(items){
 $(items).each(function(i){
$("body").append("<div class='tip' id='"+$(items).eq(i).attr("class")+'-'+i+"-tip'><p>"+$(items).eq(i).attr("alt")+"</p></div>");
var tip = $("#"+$(items).eq(i).attr("class")+'-'+i+"-tip");
 $(items).eq(i).bind("mouseover", function(){
 tip.css({opacity:0.8, display:"none"}).show();
}).bind("mousemove", function(kmouse){
 tip.css({left:kmouse.pageX+15, top:kmouse.pageY+15});
}).bind("mouseout", function(event){
 tip.hide();
});
 }).attr({"title":'',"alt":''});
}

var wlink = new Array();

function wall(items) {
$(items).each(function(i){
$("body").append("<div class='wall' id='"+$(items).eq(i).attr("rel")+'-'+i+"-wall'>"+wlink[i]+"</div>");
 });
}

var crewsrc = new Array();

function crews() {
$("body").append("<div class='cpix'><br /><div class='crew-pix'><img src='"+crewsrc[0][0]+"' alt='"+crewsrc[0][1]+"' /></div></div>");
$(".cpix").css({"width":$(".global").width()+'px'});
$(".crew-pix").eq(0).css({"left": ($(".global").width()-990)/2+'px'}).show();
cr = $(".crew-list li a");
cr.each(function(i){
cr.eq(i).bind("click", function(){
$(".cpix").append("<div class='crew-pix'><img src='"+crewsrc[i][0]+"' alt='"+crewsrc[i][1]+"' /></div>");
$(".crew-pix").eq(1).css({"left":'-990px'}).show();
$(".crew-pix").eq(1).animate({"left":($(".global").width()-990)/2+'px'},600);
$(".crew-pix").eq(0).animate({"left":$().width(".global")+'px'},600);
setTimeout(function(){$(".crew-pix").eq(0).remove();},600);
cr.removeClass("crew-a");
$(".crew-block").hide();
$(this).addClass("crew-a");
$("#"+$(this).attr("id")+"-block").show();
return false;
});
});
}


function mt_rand(min, max) {
var range = max - min + 1;
var n = Math.floor(Math.random() * range) + min;
return n;
}


$(document).ready(function () {
$("#index_page_title").bind('startShow', function () {$(this).fadeTo(3000, 0, function () {n = mt_rand(0, options.length-1);
$(this).html('<h1>' + options[n] + '</h1>').fadeTo(3000, 1, function () {$(this).trigger('startShow');
});
});
});

$("#index_page_title").trigger('startShow');

});











