//Function to show and hide the insurance type drop down options
function showHide(id)
{
	if(document.getElementById(id).style.display=='none')
	{
		document.getElementById(id).style.display='block';
	}else
	{
		document.getElementById(id).style.display='none';
	}
}

//Function to hide the insurance type drop down options when clicked anywhere in browser.
function hide_combo()
{
	document.getElementById('quotetype_list').style.display='none';
}

//Function to change insurance type when any particular insurance option is clicked.
function changeInsType(text,value,image,widget_title)
{	
	$('#quotetype_selected').text(" "+text);
	$('#quotetype_list').css('display','none');	
	
	$('#selInsuranceType').attr('value',value);
	
	var img_index = Math.floor(Math.random() * image.length);
	$('.widgetcontainer').css('background','transparent url('+image[img_index]+') no-repeat left top');
	
	$('#widget_title_txt').text(widget_title);
}

//Function to rotate affiliate images.
//Rotating Banner
function rotateBanner() {
	var objImage = document.getElementById('banner1');
	if(objImage == null) return;
	
	$('#banner1').fadeOut(2000,function()
	{
		objImage.src = banners[banner_no];
	});	
	$('#banner1').fadeIn(2000);
	
	/*$('#banner1').fadeTo(2000,0.1,function()
	{
		objImage.src = banners[banner_no];
	});	
	$('#banner1').fadeTo(2000,1);*/
		
	//banner_id_no++;	
	banner_no++;
	//if(banner_id_no == 4)
		//banner_id_no = 1;
	if(banner_no == banners.length)
		banner_no = 0;
}

//Function to change the Widget Photo when a new Insurance Type is selected from the drop down box
function changeInsImage(val)
{
	$('.widgetcontainer').css('background','transparent url('+val+') no-repeat left top');	
}