// JavaScript Document
function change(str)
{
	var Li_Id=new Array("about","integ","service","enable","models","support","career");
	var Img_Id=new Array("about_a.jpg","integration_a.jpg","services_a.jpg","enable_a.jpg","models_a.jpg","support_a.jpg","careers_a.jpg");
	var OrgImg_Id=new Array("about.jpg","integration.jpg","services.jpg","enable.jpg","models.jpg","support.jpg","careers.jpg");
	
	for(var i=0;i<7;i++)
	{
		if(str==i)
		{
		document.getElementById(Li_Id[i]).src='images/'+Img_Id[i];	
		}
		else
		{
		document.getElementById(Li_Id[i]).src='images/'+OrgImg_Id[i];	
		}
	}


}



$(document).ready(function() {		
	
	
	slideShow();

});

function slideShow() {

	
	$('#gallery a').css({opacity: 0.0});
	$('#gallery a:first').css({opacity: 1.0});
	$('#gallery .caption').css({opacity: 0.7});
	$('#gallery .caption').css({width: $('#gallery a').find('img').css('width')});
	$('#gallery .content').html($('#gallery a:first').find('img').attr('rel'))
	.animate({opacity: 0.7}, 400);
	setInterval('gallery()',2000);
	
	
}
function gallery() {

	
	var hid_val=document.getElementById("hid_status").value;
	
	if(hid_val=="0")
	{
		document.getElementById("vis").style.display='block';
		var current = ($('#gallery a.show')?  $('#gallery a.show') : $('#gallery a:first'));
		var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery a:first') :current.next()) : $('#gallery a:first'));	
		var caption = next.find('img').attr('rel');	
		var img_id=next.find('img').attr('name');
		next.css({opacity: 0.0})
		.addClass('show')
		.animate({opacity: 1.0}, 1000);
		current.animate({opacity: 0.0}, 1000)
		.removeClass('show');
		$('#gallery .caption').animate({opacity: 0.0}, { queue:false, duration:0 }).animate({height: '1px'}, { queue:true, duration:300 });	
		$('#gallery .caption').animate({opacity: 0.7},100 ).animate({height: '50px'},500 );
		$('#gallery .content').html(caption);
		var Img_val=new Array("0","1","2");
		var Tab_Id=new Array("txt1","txt2","txt3");
		for(var i=0;i<3;i++)
		{
		if(i==img_id)
		{
			document.getElementById(Tab_Id[i]).style.color='#709301';
			}
			else
			{
				
				document.getElementById(Tab_Id[i]).style.color='#9e1a18';
				}
				
		}
		
	
	}
	else
		{


		document.getElementById("vis").style.display='none';
		var Div_Id=new Array("vis0","vis1","vis2","vis3");
		for(var x=0; x<4; x++)
		{
			if(x==hid_val)
			{
				document.getElementById(Div_Id[x]).style.display='block'
			}
			else
			{
				document.getElementById(Div_Id[x]).style.display='none'
			}
		}
	
		
	
	}
	
}

function dis_txt1()
{
document.getElementById("hid_status").value="1";
document.getElementById("txt1").style.color='#709301';
}
function dis_txt2()
{
document.getElementById("hid_status").value="2";
document.getElementById("txt2").style.color='#709301';
}
function dis_txt3()
{
document.getElementById("hid_status").value="3";
document.getElementById("txt3").style.color='#709301';
}
function dis_nor()
{
document.getElementById("hid_status").value="0";
document.getElementById("txt1").style.color='#9e1a18';
document.getElementById("txt2").style.color='#9e1a18';
document.getElementById("txt3").style.color='#9e1a18';
}
