<script src="../js/jquery.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function getProduct(parentID){
var imgLoad=0;
$('#Mask').fadeIn();
$.getJSON('data.ashx',{parentID:parentID},function(result){
var content=$('#Navigation ul');
content.empty();
for(var i=0;i<result.length;i++){
content.append('<li><img val="'+result.ID+'" src="'+result.ImageUrl+'" alt="'+result.Name+'"/></li>');
}
//alert(content.find('ul'));
content.find('li').css('opacity','0.3').hover(
function(){
$(this).css('border-color','#ff0000');
$(this).stop().animate({opacity:'1'},'fast');
},
function(){
$(this).stop().animate({opacity:'0.3'},'fast',function(){$(this).css('border-color','#cccccc');});
}
);
content.find('img').each(function(){
this.onload=function(){
imgLoad++;
//alert(imgLoad);
if(imgLoad==parentID){
$('#Mask').fadeOut('slow');
}
}
});
});
}
$(function(){
var isSomeoneClick=false;
$('#Mask').css('opacity','0.3');
$('#ShowImg').css('opacity','0');
getProduct(5);
$('#productList a').click(function(){
getProduct($(this).attr('pid'));
});
});
</script>