var xmlHttp;

function fnLoadCarrierLogos(eProBrokerID, periodID, insuranceTypeID, brokerState, imageSize){

	xmlHttp = fnGetXmlHttpObject();
	
	if (xmlHttp == null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	
	var myURL = "carrierLogos.asp";
		myURL = myURL + "?eproBrokerID=" + eProBrokerID;
		myURL = myURL + "&periodID=" + periodID;
		myURL = myURL + "&insuranceTypeID=" + insuranceTypeID;
		myURL = myURL + "&brokerState=" + brokerState;
		myURL = myURL + "&imageSize=" + imageSize;
		
	xmlHttp.onreadystatechange = function(){
			if(xmlHttp.readyState == 4)
			{
				var objCarrierLogo = document.all ? document.all.datacontainer: document.getElementById("datacontainer");
					objCarrierLogo.innerHTML = xmlHttp.responseText;
					ScrollerTop.initialize(objCarrierLogo);		      			
			}
	}
	xmlHttp.open("GET", myURL, true);
	xmlHttp.send(null);
} 

function fnGetXmlHttpObject(){
	xmlHttp = null;

	try
	{
		// Firefox, Opera 8.0+, Safari
  		xmlHttp = new XMLHttpRequest();
  	}
	catch (e)
  	{
  		// Internet Explorer
  		try
    	{
    		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    	}
  		catch (e)
    	{
    		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    	}
  	}
	return xmlHttp;
}

var ScrollerTop = {
	initialize : function(objDemo) {
		this.speed		= 20;
		this.demo		= objDemo;
		this.demo.innerHTML	+= this.demo.innerHTML;
		this.demo1		= objDemo.childNodes[0];
		this.demo2		= objDemo.childNodes[1];
		this.timer		= setInterval(this.marquee, this.speed);
		this.demo.onmouseover	= function() {clearInterval(ScrollerTop.timer)};
		this.demo.onmouseout	= function() {ScrollerTop.timer = setInterval(ScrollerTop.marquee, ScrollerTop.speed)};
	},
	marquee : function() {
		if (ScrollerTop.demo.scrollTop - ScrollerTop.demo1.offsetHeight >= 0)
			ScrollerTop.demo.scrollTop -= ScrollerTop.demo1.offsetHeight;
		else
			ScrollerTop.demo.scrollTop ++;
	}
}

