﻿// JavaScript Document
			
var divt = n = 0, count=3;
if($("#play_list").height()>=214)
//$("#play").height(425);//$("#play_list").height());

$("#play").css("overflow","hidden");
$("#play_list").height(214);
$("#play_list").css("overflow","hidden");
count= $("#play_list a").size()
//$("#play_list a:not(:first-child)").hide();
//$("#play_text li").eq(0).css({"border":"2px #1762B6 solid","padding":"0px"})

$("#play_text li").mouseover(function() {
var hh = $(this).attr("value");
var i = hh - 1;
n = i;
if (i >= count) return;
$("#play_list a").filter(":visible").fadeOut(200,function(){$(this).parent().children().eq(i).fadeIn(300);});

$(this).css({"background":"url(images/gchem/parh"+hh+".gif) top right no-repeat","color":"#000000"});
$(this).siblings().each(function(i){
	var nabc = $(this).attr("value");
   $(this).css({"background":"url(images/gchem/part"+nabc+".gif) top right no-repeat","color":"#000000"});
 }); 

});

$("#play_text li").click(function() {
var hh = $(this).attr("value");
var i = hh - 1;
n = i;
if (i >= count) return;
$("#play_list a").filter(":visible").fadeOut(200,function(){$(this).parent().children().eq(i).fadeIn(300);});

$(this).css({"background":"url(images/gchem/parh"+hh+".gif) top right no-repeat","color":"#000000"});
$(this).siblings().each(function(i){
	var nabc = $(this).attr("value");
   $(this).css({"background":"url(images/gchem/part"+nabc+".gif) top right no-repeat","color":"#000000"});
 }); 
});

divt = setInterval(showAuto, 10000);
$("#play_text").hover(function(){clearInterval(divt);}, function(){divt = setInterval(showAuto, 10000);});
function showAuto()
{
	//alert(n);
	if(n >= (count - 1)){
	n = 0;
	}else{
	n = n + 1;	
	}
$("#play_text li").eq(n).trigger('mouseover');
}

//$("#play_text").eq(0).mouseover();

/*divt = setInterval(showAuto, 300000);
$("#play_text").hover(function(){clearInterval(divt);}, function(){divt = setInterval(showAuto, 10000);});
function showAuto()
{
	//alert(n);
	if(n >= (count - 1)){
	n = 0;
	}else{
	n = n + 1;	
	}
$("#play_text li").eq(n).trigger('click');
}

$("#play_text").eq(0).mouseover();
-------------*/
