// JavaScript Document
function ele_hide(id)
{
	document.getElementById(id).style.display = "none"
}
function ele_show(id)
{
	document.getElementById(id).style.display = "block"
}
function changeimgsrc(id,src)
{
	var obj = document.getElementById(id);
	obj.src = src
}
function changeclass(id,class1)
{
	document.getElementById(id).className = class1;
}
function fadein(id)
{
	id = "#" + id;
	$(id).fadeIn("slow");
}
function fadeout(id)
{
	id = "#" + id;
	$(id).fadeOut("slow");
}
function slidedown(id)
{
	id = "#" + id;
	$(id).slideDown("medium");
}
function slideup(id)
{
	id = "#" + id;
	$(id).slideUp("medium");
}
function lplinks(currid)
{
	for(i=1;i<=9;i++)
	{
		var id = "LP-link-" + i;
		if(i == Number(currid))
		{
			new slidedown(id);
		}
		else
		{
			new slideup(id);
		}
	}
}
function switchabannertabs(currid)
{
	for(i=1;i<=4;i++)
	{
		var id = "bannerpanel-" + i;
		if(Number(currid) == i)
		{
			new fadein(id);
		}
		else
		{
			new ele_hide(id);
		}
	}
}
function festivecont(currid,total)
{
	//alert(total)
	var prefetivehead = "festivehead";
	var prefetivecont = "festivecont";
	for(i=1;i<=Number(total);i++)
	{
		var fetiveheadid = prefetivehead + i;
		var fetivecontid = prefetivecont + i;		
		if(i == Number(currid))
		{
			if(document.getElementById(fetiveheadid).className == "link_festivedetsheadon")
			{
				new ele_hide(fetivecontid);
				document.getElementById(fetiveheadid).className = "link_festivedetshead";	
			}
			else
			{
				new fadein(fetivecontid);
				document.getElementById(fetiveheadid).className = "link_festivedetsheadon";
			}
		}
		else
		{
			new ele_hide(fetivecontid);
			document.getElementById(fetiveheadid).className = "link_festivedetshead";
		}
	}
}

$(document).ready(function(){
	
	//////Tab gallery//////
	
	$("#collections ul li").hover(function(){
		$(this).addClass('hover');
		//Cufon.refresh('h1');
	},function(){
		$(this).removeClass('hover')
		})
	
	$('#tbWrapper #tab01-content .btm-panel').animate({bottom:'0px'});
	
	$("#collections ul li").click(function(){
		$(this).addClass('active').siblings('li').removeClass('active');
		var tabid ='#'+$(this).attr('id')+'-content';
			//$('#tbWrapper2 div:visible').hide();
		//('#tbWrapper2 '+tabid).fadeIn();
		$('#tbWrapper2 '+tabid+' .bigImg').attr({src:'images/'+$(this).attr('id')+'-img01.jpg'})
		$('#tbWrapper2 '+tabid).fadeIn().siblings('div:visible').hide();
		$('#tbWrapper2 '+tabid).find('.btm-panel-bg').show().css({bottom:'-84px'});
		$('#tbWrapper2 '+tabid+' .btm-panel-bg').animate({bottom:'0px'});
		$('#tbWrapper2 '+tabid).find('.btm-panel').css({bottom:'-84px'});
		$('#tbWrapper2 '+tabid+' .btm-panel').animate({bottom:'0px'});
		//alert('#'+tabid+'-content')
	})
	
	
	$("#tab01-content .btm-panel img").click(function(){
		var largePath = $(this).parent('a').attr("href");
		$("#tab01-content .bigImg").attr({ src: largePath});
		//alert(largePath);
		return false;
		})
		
		$("#tab02-content .btm-panel img").click(function(){
		var largePath = $(this).parent('a').attr("href");
		$("#tab02-content .bigImg").attr({ src: largePath});
		//alert(largePath);
		return false;
		})
		
		$("#tab03-content .btm-panel img").click(function(){
		var largePath = $(this).parent('a').attr("href");
		$("#tab03-content .bigImg").attr({ src: largePath});
		//alert(largePath);
		return false;
		})
		
		$("#tab04-content .btm-panel img").click(function(){
		var largePath = $(this).parent('a').attr("href");
		$("#tab04-content .bigImg").attr({ src: largePath});
		//alert(largePath);
		return false;
		})
	
	
})
