var xmlHttp_State;
var lotterycontent = '<form name="frmLottery" id="frmLottery" method="post" action="default.aspx">';
	lotterycontent += '<div id="lottery_select">';
	lotterycontent += '<select name="lottery_selState" onchange="showState(this.value);" id="lottery_selState" class="lottery_st">';
	lotterycontent += '<option selected>Select Your State</option>';
	lotterycontent += '<option value="Indiana">Indiana</option>';
	lotterycontent += '<option value="Illinois">Illinois</option>';
	lotterycontent += '<option value="Kentucky">Kentucky</option>';
	lotterycontent += '<option value="Ohio">Ohio</option>';
	lotterycontent += '</select>';
	lotterycontent += '</div>';
	lotterycontent += '<Input type="hidden" name="hidlottery" id="hidlottery"></form>';
	
function showState(str){ 
    xmlHttp_State=zXmlHttp.createRequest();
    if (xmlHttp_State==null)
    {
    alert ("Browser does not support HTTP Request");
    return;
    } 

    var url = "";
    if (str != "") url = "/Content/Lottery/" + str + ".aspx";

	if (url =="") {
		document.getElementById("lottery_content").innerHTML = lotterycontent   ;
		Delete_Cookie( 'State', '/', cookieDomain );
	} else {
		xmlHttp_State.onreadystatechange=stateClick ;
		xmlHttp_State.open("GET",url,true);
		xmlHttp_State.send(null);
		Set_Cookie( 'State', str, 180, '/', cookieDomain, '' );
    }
}

function ChangeState(){
		var agt = navigator.userAgent;								
		var is_mac = (agt.indexOf("Mac")!=-1) && (agt.indexOf("MSIE")!=-1);					 	 
    	document.getElementById("lottery_content").innerHTML = lotterycontent;
		Delete_Cookie( 'State', '/', cookieDomain );
		if (!is_mac){
			document.location.href="#lottery";								
		}else{
			document.getElementById("lottery_select").focus();					
		}
}

function stateClick(){ 
var lotteryfooter;
	lotteryfooter = "<br /><div id='change_state'><a href='#lottery' onclick='ChangeState();'><img src='/images/home/change_state.gif' alt='CHANGE STATE' width='102' height='9' border='0'></a></div>";
    if (xmlHttp_State.readyState==4 || xmlHttp_State.readyState=="complete")
    { 
        document.getElementById('lottery_content').innerHTML=xmlHttp_State.responseText + lotteryfooter;
    } 
}






