//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');	
}


adroll_adv_id = "JVNYTW7RCVCBZELFGTT27Y";
adroll_pix_id = "2GAXCOUM4JFX5CMDO7TCOC";
(function () {
var oldonload = window.onload;
window.onload = function(){
   __adroll_loaded=true;
   var scr = document.createElement("script");
   var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com");
   scr.setAttribute('async', 'true');
   scr.type = "text/javascript";
   scr.src = host + "/j/roundtrip.js";

   ((document.getElementsByTagName('head') || [null])[0] ||
    document.getElementsByTagName('script')[0].parentNode).appendChild(scr);
   if(oldonload){oldonload()}};
}());


var _qevents = _qevents || [];
 
(function() {
var elem = document.createElement('script');
elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js";
elem.async = true;
elem.type = "text/javascript";
var scpt = document.getElementsByTagName('script')[0];
scpt.parentNode.insertBefore(elem, scpt);
})();
 
_qevents.push({
qacct:"p-7auqjDkLTInf2"
});

