// JavaScript Document

function changeImages() {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
}

function clearInput(element, defaultValue){
	if(element.value == defaultValue)
		element.value = "";
}

function setInput(element, defaultValue){
	if(element.value == "")
		element.value = defaultValue;
}

function printIframe(id) {
    var iframe = document.frames ? document.frames[id] : document.getElementById(id);
    var ifWin = iframe.contentWindow || iframe;
    ifWin.printPage();
    return false;
}


function changeImgBorder(image_id,border_color)
	{
	if (document.getElementById)
		{
 		var image;
 		image=document.getElementById(image_id);
 		if (image) 
  			{
   			image.style.border='2px solid #'+border_color;
			}
  		}
	else
		{
		getOldMessage();
		}
	}

function getOldMessage()
	{
	alert('Please upgrade your current browser or use another one to view the content on this page.');
	}
	
function loadXMLDoc(doc_name) 
	{
	var xmlDoc;
	if (window.XMLHttpRequest)
  		{
  		xmlDoc=new window.XMLHttpRequest();
  		xmlDoc.open("GET",doc_name,false);
  		xmlDoc.send("");
  		return xmlDoc.responseXML;
  		}
	// IE 5 and IE 6
	else if (ActiveXObject("Microsoft.XMLDOM"))
  		{
  		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  		xmlDoc.async=false;
  		xmlDoc.load(doc_name);
		return xmlDoc;
  		}
	alert("XML document did not load");
	return null;
	}

function setOpacity(objectID, opacityAsInt)
	{
	elem = findDOM(objectID,1);
	var opacityAsDecimal = opacityAsInt;
	if (opacityAsInt > 100)
		{
		opacityAsInt = opacityAsDecimal = 100;
		}
	else if (opacityAsInt < 0)
		{
		opacityAsInt = opacityAsDecimal = 0;
		}
	opacityAsDecimal /= 100;
	if (opacityAsInt < 1)
		{
		opacityAsInt = 0; // IE7 bug, text smoothing cuts out if 0
		}
	elem.opacity = (opacityAsDecimal);
	elem.filter  = "alpha(opacity=" + opacityAsInt + ")";
	}
	
popup_used=false;
function getPopup(delegate_id)
	{
	if (document.getElementById)
		{
		popup_used=true;
		currObject='delegate_popup';
		xmlDoc=loadXMLDoc("delegates.xml");
		
		newName=xmlDoc.getElementsByTagName("name")[delegate_id-1].childNodes[0].nodeValue;
		newName=newName.split(", ");
		newName=newName[1]+" "+newName[0];
		newDistrict=xmlDoc.getElementsByTagName("district")[delegate_id-1].childNodes[0].nodeValue;
		newHome=xmlDoc.getElementsByTagName("birthplace")[delegate_id-1].childNodes[0].nodeValue;
		newJob=xmlDoc.getElementsByTagName("occupation")[delegate_id-1].childNodes[0].nodeValue;
		newAge=xmlDoc.getElementsByTagName("age")[delegate_id-1].childNodes[0].nodeValue;
		newArrival=xmlDoc.getElementsByTagName("arrival")[delegate_id-1].childNodes[0].nodeValue;
		newArrival=newArrival.split(", ");
		if (newArrival[1]!=null)
			{
			newArrival=newArrival[1].charAt(0)+newArrival[1].charAt(1)+newArrival[1].charAt(2)+" "+newArrival[0];
			}
		newHTML='';
		newHTML+='<div id="popup_header">';
		newHTML+='	<div class="floatL"><img src="images/header_delegateconnection.gif" width="190" height="18" alt="Delegate Connection" /></div>';
		newHTML+='	<div class="floatR" style="margin-right:7px;"><a href="#" onclick="hideIt(\'delegate_popup\'); hideIt(\'bg_popup\'); return false;"><img src="images/btn_close.gif" width="19" height="18" alt="Close Popup" border="0" /></a></div>';
		newHTML+='</div>';
		newHTML+='<div id="popup_content">';
		newHTML+='	<div id="popup_title">'+newName+', representing '+newDistrict+'</div>';
		newHTML+='	<div id="popup_bg">';
		newHTML+='		<div id="popup_image"><img src="images/bio_pic'+delegate_id+'.jpg" width="248" height="350" alt="Image of '+newName+'" /><br clear="left" /></div>';
		newHTML+='		<div id="popup_info1">Birthplace: <strong>'+newHome+'</strong><br />';
		newHTML+='			Occupation: <strong>'+newJob+'</strong></div>';
		newHTML+='		<div id="popup_info2">Age in 1836: <strong>'+newAge+' years old</strong><br />';
		newHTML+='			Arrived in Texas: <strong>'+newArrival+'</strong></div>';
		newHTML+='		<br clear="left" />';
		newHTML+='		<div id="popup_padding">';
		entry_found=false;

		var x=xmlDoc.getElementsByTagName("pre_1836p")[delegate_id-1];
		item_found=false;
		for (i=0; i<x.getElementsByTagName("bullet").length; i++)
			{
			if (!(x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue==undefined))
				{
				if (x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue!="none")
					{
					if (i==0)
						{
						if (entry_found==true)
							{
							newHTML+='<div><br /><strong class="maroon_12px">Political life before the Convention:</strong></div>';
							}
						else
							{
							newHTML+='<div><strong class="maroon_12px">Political life before the Convention:</strong></div>';
							}
						newHTML+='<ul>';
						}
				
					newHTML+='<li class="popup_list">'+x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue+'</li>';
					entry_found=true;
					item_found=true;
					}
				}
			}
		if (item_found==true)
			{
			newHTML+='</ul>';
			item_found=false;
			}
		var x=xmlDoc.getElementsByTagName("pre_1836m")[delegate_id-1];
		for (i=0; i<x.getElementsByTagName("bullet").length; i++)
			{
			if (!(x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue==undefined))
				{
				if (x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue!="none")
					{
					if (i==0)
						{
						if (entry_found==true)
							{
							newHTML+='<div><br /><strong class="maroon_12px">Military life before the Convention:</strong></div>';
							}
						else
							{
							newHTML+='<div><strong class="maroon_12px">Military life before the Convention:</strong></div>';
							}
						newHTML+='<ul>';
						}
				
					newHTML+='<li class="popup_list">'+x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue+'</li>';
					entry_found=true;
					item_found=true;
					}
				}
			}
		if (item_found==true)
			{
			newHTML+='</ul>';
			item_found=false;
			}
		var x=xmlDoc.getElementsByTagName("washington")[delegate_id-1];
		for (i=0; i<x.getElementsByTagName("bullet").length; i++)
			{
			if (!(x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue==undefined))
				{
				if (x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue!="none")
					{
					if (i==0)
						{
						if (entry_found==true)
							{
							newHTML+='<div><br /><strong class="maroon_12px">During the Convention:</strong></div>';
							}
						else
							{
							newHTML+='<div><strong class="maroon_12px">During the Convention:</strong></div>';
							}
						newHTML+='<ul>';
						}
				
					newHTML+='<li class="popup_list">'+x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue+'</li>';
					entry_found=true;
					item_found=true;
					}
				}
			}
		if (item_found==true)
			{
			newHTML+='</ul>';
			item_found=false;
			}
		var x=xmlDoc.getElementsByTagName("family_life")[delegate_id-1];
		for (i=0; i<x.getElementsByTagName("bullet").length; i++)
			{
			if (!(x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue==undefined))
				{
				if (x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue!="none")
					{
					if (i==0)
						{
						if (entry_found==true)
							{
							newHTML+='<div><br /><strong class="maroon_12px">Family life:</strong></div>';
							}
						else
							{
							newHTML+='<div><strong class="maroon_12px">Family life:</strong></div>';
							}
						newHTML+='<ul>';
						}
				
					newHTML+='<li class="popup_list">'+x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue+'</li>';
					entry_found=true;
					item_found=true;
					}
				}
			}
		if (item_found==true)
			{
			newHTML+='</ul>';
			item_found=false;
			}
		var x=xmlDoc.getElementsByTagName("gray")[delegate_id-1];
		for (i=0; i<x.getElementsByTagName("bullet").length; i++)
			{
			if (!(x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue==undefined))
				{
				if (x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue!="none")
					{
					if (i==0)
						{
						if (entry_found==true)
							{
							newHTML+='<div><br /><strong class="maroon_12px">According to William Fairfax Gray:</strong></div>';
							}
						else
							{
							newHTML+='<div><strong class="maroon_12px">According to William Fairfax Gray:</strong></div>';
							}
						newHTML+='<ul>';
						}
				
					newHTML+='<li class="popup_list">'+x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue+'</li>';
					entry_found=true;
					item_found=true;
					}
				}
			}
		if (item_found==true)
			{
			newHTML+='</ul>';
			item_found=false;
			}
		var x=xmlDoc.getElementsByTagName("other_text")[delegate_id-1];
		for (i=0; i<x.getElementsByTagName("bullet").length; i++)
			{
			if (!(x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue==undefined))
				{
				if (x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue!="none")
					{
					if (i==0)
						{
						if (entry_found==true)
							{
							newHTML+='<div><br /><strong class="maroon_12px">More Information:</strong></div>';
							}
						else
							{
							newHTML+='<div><strong class="maroon_12px">More Information:</strong></div>';
							}
						newHTML+='<ul>';
						}
				
					newHTML+='<li class="popup_list">'+x.getElementsByTagName("bullet")[i].childNodes[0].nodeValue+'</li>';
					entry_found=true;
					item_found=true;
					}
				}
			}
		if (item_found==true)
			{
			newHTML+='</ul>';
			}
		newHTML+='			<div id="popup_links"></div>';
		//newHTML+='			<div class="floatL"><a href="#" class="link_maroon12px">Read his Handbook of Texas entry</a></div>';
		newHTML+='			<div class="floatR"><a href="#" onclick="hideIt(\'delegate_popup\'); hideIt(\'bg_popup\'); return false;" class="link_maroon12px">Back to Search List</a></div>';
		newHTML+='			<br clear="right" />';
		newHTML+='			<div class="height_1px"><br clear="left" /></div>';
		newHTML+='		</div>';
		newHTML+='		<div class="height_1px"><br clear="left" /></div>';
		newHTML+='	</div>';
		newHTML+='	<div id="popup_bgB"></div>';
		newHTML+='</div>';
		
		document.getElementById('delegate_popup').innerHTML=newHTML;
		
		showObj(currObject);
		showObj('bg_popup');
		document.getElementById("bg_popup").style.height = (document.getElementById('main_body').offsetHeight+6)+"px";
		setOpacity("bg_popup",80);
		}
	}
	
prevNum=0;
currNum=0;
currMunicipality="";
function getMunicipality(num,obj,municipality)
	{
	//municipality_popup
	if (document.getElementById)
		{
		currMunicipality=obj;
		getXCoord(obj);
		getYCoord(obj);
		currNum=num;
		showIt("municipality_popup",num,municipality,"municipality_popupTitle");
		}
	else
		{
		getOldMessage();
		}
	}
currBirthplace="";
function getBirthplace(num,obj,birthplace)
	{
	//birthplace_popup
	if (document.getElementById)
		{
		currBirthplace=obj;
		getXCoord(obj);
		getYCoord(obj);
		currNum=num;
		showBirthplace("birthplace_popup",num,birthplace,"birthplace_popupTitle");
		}
	else
		{
		getOldMessage();
		}
	}
	
birthplace_used=false;
birthplace_num=0;
function showBirthplace(obj,num,birthplace,obj_title)
	{
	birthplace_used=true;
	birthplace_num=num;
	popup_used=false;
	element = findDOM(obj,1);
	state = element.visibility;
	if (num==12)
		{
		element.top=(curtop-128)+"px";
		}
	else
		{
		element.top=(curtop-16)+"px";
		}
	element.left=(curleft+118)+"px";
	
	element_title=findDOM(obj_title,1);
	state = element_title.visibility;
	element_title.top=(curtop-2)+"px";
	element_title.left=(curleft-12)+"px";
	
	html_stringTitle='<div id="birthplace"><strong class="brown_text14px">'+birthplace+'</strong></div>';
	
	if (num==1)
		{
		html_string='<div style="margin-top:8px;"><img src="images/bg_municipalityT.gif" width="155" height="8" alt="" /></div><div id="municipality_content">';
		}
	else
		{
		html_string='<div><img src="images/bg_municipalityT.gif" width="155" height="8" alt="" /></div><div id="municipality_content">';
		}
	xmlDoc=loadXMLDoc("delegates.xml");
	for (i=1; i<xmlDoc.getElementsByTagName("birthplace").length+1; i++)
		{
		tempBirthplace=xmlDoc.getElementsByTagName("birthplace")[i-1].childNodes[0].nodeValue;
		tempBirthplace=tempBirthplace.split(", ");
		if (tempBirthplace[0]==birthplace)
			{
			tempString=xmlDoc.getElementsByTagName("name")[i-1].childNodes[0].nodeValue;
			tempString=tempString.split(", ");
			tempString=tempString[1]+" "+tempString[0];
			html_string+='<div style="padding-bottom:6px; padding-left:12px;"><a href="#" onclick="getPopup('+i+'); return false;" class="link_maroon12px">'+tempString+'</a></div>';
			}
		}
	
	html_string+='</div><div><img src="images/bg_municipalityB.gif" width="150" height="8" alt="" /></div>';
	document.getElementById('municipality_title').innerHTML=html_stringTitle;
	document.getElementById('municipality_content').innerHTML=html_string;
	
	if (element.visibility=='visible' && prevNum==currNum)
		{
		element.visibility = 'hidden';
		element_title.visibility = 'hidden';
		}
	else
		{
		element.visibility = 'visible';
		element_title.visibility = 'visible';
		}
	prevNum=currNum;

	checkBrowserWidth();
	attachEventListener(window,"resize",checkBrowserWidth,false);
	}
	
isDHTML=0;
isLayers=0;
isAll=0;
isID=0;

if (document.getElementById)
	{
	isID=1;
	isDHTML=1;
	}
else
	{
	if (document.layers)
		{
		isLayers=1;
		isDHTML=1;
		}
	else
		{
		if (document.all)
			{
			isAll=1;
			isDHTML=1;
			}
		}
	}

function findDOM(obj,withStyle)
	{
	if (withStyle == 1)
		{
		if (isID)
			{
			return (document.getElementById(obj).style);
			}
		else
			{ 
			if (isAll)
				{
				return (document.all[obj].style);
				}
			else
				{
				if (isLayers)
					{
					return (document.layers[obj]);
					}
				}
			}
		}
	else {
		if (isID)
			{
			return (document.getElementById(obj));
			}
		else
			{ 
			if (isAll)
				{
				return (document.all[obj]);
				}
			else
				{
				if (isLayers)
					{
					return (document.layers[obj]);
					}
				}
			}
		}
	}



function showObj(obj)
	{
	element = findDOM(obj,1);
	state = element.visibility;	
	element.visibility = 'visible';
	}

function hideIt(obj)
	{
	element = findDOM(obj,1);
	state = element.visibility;	
	element.visibility = 'hidden';
	}

municipality_used=false;
currObject="";
function showIt(obj,num,municipality,obj_title)
	{
	municipality_used=true;
	popup_used=false;
	element = findDOM(obj,1);
	state = element.visibility;
	element.top=(curtop-16)+"px";
	element.left=(curleft+128)+"px";
	
	element_title=findDOM(obj_title,1);
	state = element_title.visibility;
	element_title.top=(curtop-2)+"px";
	element_title.left=(curleft-12)+"px";
	
	if (num==16)
		{
		html_stringTitle='<div id="municipalityL"><strong class="brown_text15px">'+municipality+'</strong></div>';
		}
	else
		{
		html_stringTitle='<div id="municipality"><strong class="brown_text15px">'+municipality+'</strong></div>';
		}
	
	if (num==1)
		{
		html_string='<div style="margin-top:8px;"><img src="images/bg_municipalityT.gif" width="210" height="8" alt="" /></div><div id="municipality_content">';
		}
	else
		{
		html_string='<div><img src="images/bg_municipalityT.gif" width="210" height="8" alt="" /></div><div id="municipality_content">';
		}
	xmlDoc=loadXMLDoc("delegates.xml");
	for (i=1; i<xmlDoc.getElementsByTagName("district").length+1; i++)
		{
		if (xmlDoc.getElementsByTagName("district")[i-1].childNodes[0].nodeValue==municipality && num!=16)
			{
			tempString=xmlDoc.getElementsByTagName("name")[i-1].childNodes[0].nodeValue;
			tempString=tempString.split(", ");
			tempString=tempString[1]+" "+tempString[0];
			html_string+='<div style="padding-bottom:6px; padding-left:12px;"><a href="#" onclick="getPopup('+i+'); return false;" class="link_maroon12px">'+tempString+'</a></div>';
			}
		else if (xmlDoc.getElementsByTagName("district")[i-1].childNodes[0].nodeValue=="Pecan Point and Vicinity" && num==16)
			{
			tempString=xmlDoc.getElementsByTagName("name")[i-1].childNodes[0].nodeValue;
			tempString=tempString.split(", ");
			tempString=tempString[1]+" "+tempString[0];
			html_string+='<div style="padding-bottom:6px; padding-left:12px;"><a href="#" onclick="getPopup('+i+'); return false;" class="link_maroon12px">'+tempString+'</a></div>';
			}
		}
	
	html_string+='</div><div><img src="images/bg_municipalityB.gif" width="210" height="8" alt="" /></div>';
	document.getElementById('municipality_title').innerHTML=html_stringTitle;
	document.getElementById('municipality_content').innerHTML=html_string;
	
	if (element.visibility=='visible' && prevNum==currNum)
		{
		element.visibility = 'hidden';
		element_title.visibility = 'hidden';
		}
	else
		{
		element.visibility = 'visible';
		element_title.visibility = 'visible';
		}
	prevNum=currNum;

	checkBrowserWidth();
	attachEventListener(window,"resize",checkBrowserWidth,false);
	}
	
function toggleObj(obj,image_id,url_off,url_on)
	{
	element = findDOM(obj,1);
	state = element.visibility;
	if (element.visibility=='visible')
		{
		element.visibility = 'hidden';
		if (url_off)
			{
			changeImages(image_id,url_off);
			}
		}
	else
		{
		element.visibility = 'visible';
		if (url_on)
			{
			changeImages(image_id,url_on);
			}
		}
	}
	
area_coords1=["poly","Anderson","381,195,403,192,405,204,410,209,410,213,393,216,393,215,395,211,391,210,384,204"];
area_coords2=["rect","Andrews","129,173,159,191"];
area_coords3=["poly","Angelina","419,220,425,215,426,218,435,220,449,234,441,236,439,237,426,233,421,223"];
area_coords4=["poly","Aransas","343,357,355,355,359,362,345,377,338,366,345,361"];
area_coords5=["rect","Archer","277,116,296,134"];
area_coords6=["rect","Armstrong","181,58,200,75"];
area_coords7=["poly","Atascosa","283,315,297,321,308,334,300,341,283,341"];
area_coords8=["poly","Austin","360,279,372,278,377,279,377,277,381,280,379,287,384,294,381,302,380,299,377,298,373,294,372,290,367,289"];
area_coords9=["rect","Bailey","130,96,145,116"];
area_coords10=["poly","Bandera","251,285,269,286,283,294,278,301,276,301,276,298,254,298,254,286"];
area_coords11=["poly","Bastrop","334,264,336,263,345,272,347,280,336,292,325,280,321,281,330,273"];
area_coords12=["rect","Baylor","258,116,276,134"];
area_coords13=["poly","Bee","309,340,312,338,319,340,322,345,327,346,329,349,334,353,327,363,318,361"];
area_coords14=["poly","Bell","315,236,333,225,336,229,338,227,345,239,338,244,336,249,318,242"];
area_coords15=["poly","Bexar","283,294,291,293,300,293,300,299,308,305,297,321,283,315"];
area_coords16=["poly","Blanco","290,259,300,259,307,262,302,278,296,284,290,274"];
area_coords17=["rect","Borden","178,155,197,172"];
area_coords18=["poly","Bosque","325,186,328,189,331,190,331,195,334,196,333,199,337,204,336,207,326,213,323,207,321,209,312,194"];
area_coords19=["poly","Bowie","430,121,443,126,455,127,455,140,449,139,447,141,442,141,439,139,433,141,429,137"];
area_coords20=["poly","Brazoria","389,314,391,311,397,312,400,307,403,306,404,300,409,299,411,301,412,306,419,320,400,335,395,327,392,326"];
area_coords21=["poly","Brazos","375,239,378,245,378,257,381,263,378,266,373,265,371,261,366,255,362,254,363,251,368,250,368,245"];
area_coords22=["poly","Brewster","102,264,115,253,156,287,154,293,137,316,126,327,117,326,103,315,103,314"];
area_coords23=["rect","Briscoe","187,76,204,94"];
area_coords24=["poly","Brooks","293,400,312,400,312,421,296,421,296,410"];
area_coords25=["poly","Brown","269,192,278,192,287,208,284,209,283,212,276,217,273,218,269,218"];
area_coords26=["poly","Burleson","350,257,362,250,363,251,362,254,366,255,371,261,373,265,360,269,352,262"];
area_coords27=["poly","Burnet","294,237,316,237,318,241,311,251,310,255,306,262,299,260,300,258,297,256"];
area_coords28=["poly","Caldwell","321,280,325,279,336,291,325,297,321,295,316,287"];
area_coords29=["poly","Calhoun","351,343,360,339,371,350,370,355,359,362,351,347,351,343"];
area_coords30=["rect","Callahan","253,173,271,191"];
area_coords31=["poly","Cameron","317,439,328,442,331,440,330,434,333,430,333,437,337,449,342,451,343,457,332,463,323,455,317,453"];
area_coords32=["poly","Camp","414,153,416,150,421,149,426,153,430,157,414,157"];
area_coords33=["rect","Carson","182,38,199,57"];
area_coords34=["poly","Cass","433,141,439,139,442,141,447,141,449,139,455,140,455,157,433,157"];
area_coords35=["rect","Castro","149,76,167,94"];
area_coords36=["poly","Chambers","421,287,440,286,442,287,442,301,428,310,422,295,422,289"];
area_coords37=["poly","Cherokee","420,190,403,190,405,204,410,209,410,213,414,214,419,220,425,215,422,211,420,203"];
area_coords38=["rect","Childress","225,76,239,94"];
area_coords39=["poly","Clay","297,106,298,102,309,103,314,110,313,114,313,133,297,133"];
area_coords40=["rect","Cochran","129,117,145,135"];
area_coords41=["rect","Coke","210,192,232,208"];
area_coords42=["poly","Coleman","250,192,269,192,269,218,263,219,262,218,254,217,251,213,250,214"];
area_coords43=["poly","Collin","354,134,371,134,371,138,374,137,374,153,354,153"];
area_coords44=["rect","Collingsworth","220,58,239,75"];
area_coords45=["poly","Colorado","352,298,363,284,367,289,372,290,373,293,377,298,372,303,372,307,362,314,361,313,360,312,363,309,356,301"];
area_coords46=["poly","Comal","288,293,301,280,313,292,305,298,300,299,300,293"];
area_coords47=["poly","Comanche","278,192,292,184,300,198,303,196,307,202,295,209,293,206,287,208,278,192"];
area_coords48=["poly","Concho","236,214,250,214,254,219,254,236,236,236"];
area_coords49=["poly","Cooke","330,113,350,111,350,133,330,133,330,113"];
area_coords50=["poly","Coryell","321,209,323,207,333,225,315,236,306,220,304,221,303,220"];
area_coords51=["poly","Cottle","221,95,240,95,240,98,237,99,237,116,221,116"];
area_coords52=["poly","Crane","140,211,156,211,156,235,154,235,152,233,151,229,148,227,146,227,143,224,140,226"];
area_coords53=["poly","Crockett","156,236,205,236,205,270,176,270,180,266,177,264,181,257,179,253,176,253,170,240"];
area_coords54=["rect","Crosby","184,117,201,135"];
area_coords55=["poly","Culberson","63,195,95,194,92,234,62,254"];
area_coords56=["poly","Dallam","130,1,162,1,162,20,130,20"];
area_coords57=["rect","Dallas","346,153,364,171"];
area_coords58=["rect","Dawson","160,155,177,172"];
area_coords59=["rect","Deaf Smith","130,58,160,75"];
area_coords60=["poly","Delta","389,131,399,131,410,137,399,137,389,144"];
area_coords61=["rect","Denton","334,133,353,152"];
area_coords62=["poly","Dewitt","324,321,340,309,349,320,337,331,333,328,327,333,321,325"];
area_coords63=["rect","Dickens","202,116,220,135"];
area_coords64=["rect","Dimmit","235,341,260,360"];
area_coords65=["rect","Donley","201,58,219,75"];
area_coords66=["poly","Duval","283,367,303,367,303,400,293,400,292,396,283,396"];
area_coords67=["poly","Eastland","272,173,294,173,295,182,278,192,272,192"];
area_coords68=["rect","Ector","138,192,157,210"];
area_coords69=["poly","Edwards","215,270,248,270,248,278,240,280,238,289,238,298,215,298"];
area_coords70=["poly","El Paso","0,195,24,195,24,223,15,218,1,203"];
area_coords71=["poly","Ellis","345,172,366,172,368,179,369,182,350,193,345,184"];
area_coords72=["poly","Erath","294,173,309,173,317,191,305,199,303,196,300,198,292,184,295,181"];
area_coords73=["poly","Falls","338,227,355,216,362,228,345,239"];
area_coords74=["poly","Fannin","371,121,378,116,387,113,389,116,389,134,371,138"];
area_coords75=["poly","Fayette","337,291,347,280,354,275,359,276,360,279,363,284,352,298,342,298"];
area_coords76=["rect","Fisher","216,154,233,172"];
area_coords77=["rect","Floyd","183,95,201,116"];
area_coords78=["poly","Foard","240,98,247,105,257,106,259,105,259,116,258,116,258,120,240,116,237,116,237,99"];
area_coords79=["poly","Fort Bend","390,291,393,294,404,300,403,306,400,307,397,312,391,311,389,314,385,311,384,307,382,306,381,302,384,294,390,291"];
area_coords80=["poly","Franklin","409,135,416,135,416,150,414,153,409,153"];
area_coords81=["poly","Freestone","366,203,381,196,384,204,392,211,376,220"];
area_coords82=["rect","Frio","261,322,282,341"];
area_coords83=["rect","Gaines","129,155,159,172"];
area_coords84=["poly","Galveston","411,301,412,306,419,320,429,311,422,296,418,302,414,304,411,301,411,301"];
area_coords85=["rect","Garza","184,136,201,154"];
area_coords86=["rect","Gillespie","264,260,290,275"];
area_coords87=["rect","Glasscock","176,192,193,210"];
area_coords88=["poly","Goliad","319,340,327,334,327,333,333,328,338,331,341,332,343,346,334,353,329,349,327,346,322,345"];
area_coords89=["poly","Gonzales","317,309,325,298,337,291,342,298,340,300,340,309,324,321,321,315,317,309"];
area_coords90=["rect","Gray","200,38,219,57"];
area_coords91=["poly","Grayson","350,111,362,113,371,121,371,134,354,134,354,133,350,133"];
area_coords92=["poly","Gregg","430,166,423,172,420,173,420,180,435,180,438,178,431,178"];
area_coords93=["poly","Grimes","378,245,389,244,390,271,381,272,380,268,379,268,378,265,381,263,378,257"];
area_coords94=["poly","Guadalupe","316,288,321,296,325,298,317,309,305,309,308,305,300,299,305,298,313,292"];
area_coords95=["rect","Hale","164,95,182,116"];
area_coords96=["rect","Hall","205,76,224,94"];
area_coords97=["poly","Hamilton","312,194,321,209,303,220,295,209,307,202,305,199"];
area_coords98=["poly","Hansford","182,1,200,1,200,20,182,20"];
area_coords99=["poly","Hardeman","240,84,243,84,258,92,259,105,257,106,247,105,240,98"];
area_coords100=["poly","Hardin","430,260,453,259,451,274,446,274,444,278,433,277"];
area_coords101=["poly","Harris","385,276,391,278,398,277,399,275,409,280,416,274,422,289,422,296,418,302,414,304,409,299,404,300,393,294,390,291"];
area_coords102=["poly","Harrison","430,161,437,166,443,166,446,163,448,166,455,166,455,179,443,181,438,178,431,178"];
area_coords103=["rect","Hartley","130,20,161,38"];
area_coords104=["rect","Haskell","240,135,258,153"];
area_coords105=["poly","Hays","305,267,321,281,313,292,301,280"];
area_coords106=["rect","Hemphill","220,20,239,37"];
area_coords107=["poly","Henderson","369,180,404,180,403,192,381,195,382,192,371,181,369,182"];
area_coords108=["poly","Hidalgo","300,421,312,421,312,432,312,435,317,436,317,452,307,454,289,446"];
area_coords109=["poly","Hill","330,190,332,187,345,184,350,193,352,192,358,203,350,208,346,202,336,207,337,204,333,199,334,196,331,195,331,190"];
area_coords110=["rect","Hockley","146,117,164,135"];
area_coords111=["poly","Hood","310,171,326,172,326,182,319,181,315,185,309,173"];
area_coords112=["poly","Hopkins","389,144,399,137,409,137,409,153,397,153,389,152"];
area_coords113=["poly","Houston","392,217,392,216,410,213,414,214,421,223,398,241,395,239,396,236,391,234,395,224,396,224"];
area_coords114=["rect","Howard","179,173,197,191"];
area_coords115=["poly","Hudspeth","24,195,63,195,62,254,57,252,46,245,24,223"];
area_coords116=["poly","Hunt","374,137,389,134,389,152,386,153,385,158,374,158"];
area_coords117=["rect","Hutchinson","182,20,199,37"];
area_coords118=["rect","Irion","194,216,214,235"];
area_coords119=["rect","Jack","297,133,314,152"];
area_coords120=["poly","Jackson","361,312,362,314,361,316,372,327,372,342,366,345,360,339,353,324,350,322"];
area_coords121=["poly","Jasper","459,232,460,237,459,271,452,271,454,254,448,244,447,238,441,236,449,234"];
area_coords122=["poly","Jeff Davis","62,254,92,234,115,253,102,264,95,264"];
area_coords123=["poly","Jefferson","439,278,444,278,446,274,451,274,455,281,462,283,462,297,452,296,442,301,442,287,439,286"];
area_coords124=["poly","Jim Hogg","278,400,283,400,283,396,292,396,296,410,296,421,278,421,278,400"];
area_coords125=["poly","Jim Wells","303,367,317,367,319,368,314,374,313,385,310,385,310,400,303,400"];
area_coords126=["poly","Johnson","326,172,345,172,345,184,332,187,330,190,328,189,325,186,326,181"];
area_coords127=["rect","Jones","234,153,253,171"];
area_coords128=["poly","Karnes","321,315,324,321,321,325,327,334,319,340,311,338,304,330"];
area_coords129=["poly","Kaufman","364,160,374,160,374,158,382,158,382,180,369,180,364,171"];
area_coords130=["poly","Kendall","279,276,291,276,297,284,288,293,283,294,279,292"];
area_coords131=["poly","Kenedy","312,401,322,398,322,398,325,397,328,396,332,398,333,399,331,397,336,397,332,428,312,428"];
area_coords132=["rect","Kent","202,136,220,154"];
area_coords133=["poly","Kerr","248,270,264,270,264,276,279,276,279,292,269,286,251,285,250,278,248,278"];
area_coords134=["poly","Kimble","236,251,258,251,258,260,264,260,264,270,236,270"];
area_coords135=["rect","King","221,116,239,135"];
area_coords136=["poly","Kinney","215,298,235,298,235,322,215,322,211,318,211,316,215,310,215,298"];
area_coords137=["poly","Kleberg","310,385,316,385,318,387,340,388,336,396,332,397,328,396,325,397,322,398,322,398,312,401,312,400,310,400"];
area_coords138=["poly","Knox","240,116,258,120,258,135,240,135"];
area_coords139=["rect","La Salle","261,342,282,367"];
area_coords140=["poly","Lamar","389,115,393,112,400,110,409,114,409,136,399,131,389,131"];
area_coords141=["rect","Lamb","146,95,163,116"];
area_coords142=["poly","Lampasas","291,229,306,220,316,237,295,237,295,234"];
area_coords143=["poly","Lavaca","340,309,340,300,342,298,352,298,356,301,363,310,350,322,349,320"];
area_coords144=["poly","Lee","341,262,350,257,352,262,360,269,354,275,347,280,345,272,336,263"];
area_coords145=["poly","Leon","372,223,393,210,395,211,392,217,396,224,395,224,391,234,384,235,375,239,372,229"];
area_coords146=["poly","Liberty","415,267,425,261,430,260,433,277,439,278,439,286,421,287,416,274,415,267"];
area_coords147=["poly","Limestone","350,208,358,203,366,203,376,220,362,229"];
area_coords148=["rect","Lipscomb","220,1,239,19"];
area_coords149=["poly","Live Oak","308,334,312,339,309,340,318,361,315,364,316,367,300,367,300,341,308,334"];
area_coords150=["poly","Llano","278,242,295,242,297,257,300,258,299,260,278,260"];
area_coords151=["poly","Loving","120,195,95,195,104,207,107,207,110,211,120,210"];
area_coords152=["rect","Lubbock","165,117,183,135"];
area_coords153=["rect","Lynn","165,136,183,154"];
area_coords154=["poly","Madison","375,239,384,235,391,234,396,236,395,239,398,241,388,245,378,245"];
area_coords155=["poly","Marion","430,157,455,157,455,166,448,166,446,163,443,166,437,166,430,161"];
area_coords156=["rect","Martin","160,172,178,190"];
area_coords157=["rect","Mason","258,242,277,259"];
area_coords158=["poly","Matagorda","389,315,392,326,395,327,400,335,375,349,372,341,372,327"];
area_coords159=["poly","Maverick","215,322,235,322,235,361,232,361,228,357,216,329"];
area_coords160=["poly","McCulloch","250,214,251,213,254,217,262,218,263,219,269,218,273,218,273,242,258,242,258,241,254,241,254,219"];
area_coords161=["poly","McLennan","326,213,346,202,355,216,336,229"];
area_coords162=["rect","McMullen","283,341,299,366"];
area_coords163=["poly","Medina","261,298,276,298,276,301,278,301,283,294,283,322,261,322"];
area_coords164=["poly","Menard","236,236,254,236,254,241,258,241,258,251,236,251"];
area_coords165=["rect","Midland","158,192,175,210"];
area_coords166=["poly","Milam","336,249,338,244,353,234,362,250,341,262,337,250"];
area_coords167=["poly","Mills","273,218,276,217,283,212,284,209,287,208,293,206,295,209,304,221,291,229,284,222,273,219"];
area_coords168=["rect","Mitchell","198,173,215,191"];
area_coords169=["poly","Montague","313,114,324,109,327,109,330,113,330,133,313,133"];
area_coords170=["poly","Montgomery","389,254,398,260,407,260,407,262,413,268,415,267,416,274,409,280,399,275,397,277,391,278,390,271"];
area_coords171=["rect","Moore","162,20,181,37"];
area_coords172=["poly","Morris","426,135,433,141,433,157,430,157,426,153,426,136"];
area_coords173=["rect","Motley","202,95,220,115"];
area_coords174=["poly","Nacogdoches","420,203,440,203,441,210,445,216,444,229,435,220,426,218,425,215,421,210"];
area_coords175=["poly","Navarro","369,182,352,192,358,203,366,203,381,196,382,192,371,181"];
area_coords176=["poly","Newton","459,232,472,230,473,245,467,272,459,271,460,237,459,232"];
area_coords177=["rect","Nolan","216,173,233,191"];
area_coords178=["poly","Nueces","340,387,341,384,333,376,323,372,319,371,319,368,314,374,313,385,316,385,318,387"];
area_coords179=["rect","Ochiltree","200,1,219,19"];
area_coords180=["rect","Oldham","130,38,160,57"];
area_coords181=["poly","Orange","452,271,460,271,467,272,467,280,461,283,455,281,451,275"];
area_coords182=["rect","Palo Pinto","291,153,309,172"];
area_coords183=["poly","Panola","438,178,434,190,434,197,455,196,455,179,443,181"];
area_coords184=["rect","Parker","310,152,327,170"];
area_coords185=["rect","Parmer","130,75,148,94"];
area_coords186=["poly","Pecos","129,224,134,224,137,226,140,226,143,224,146,227,148,227,151,229,152,233,154,235,156,235,156,236,170,240,176,253,162,253,162,255,154,255,154,269,146,269,146,279,110,249"];
area_coords187=["poly","Polk","426,233,436,236,433,238,436,260,425,261,423,257,419,257,419,253,415,252,412,246"];
area_coords188=["rect","Potter","161,38,181,58"];
area_coords189=["poly","Presidio","102,264,103,314,90,310,76,297,70,285,60,253,62,254,95,264"];
area_coords190=["poly","Rains","385,158,389,163,393,163,396,165,398,165,397,153,389,152,386,153"];
area_coords191=["rect","Randall","161,58,180,75"];
area_coords192=["rect","Reagan","176,211,193,235"];
area_coords193=["poly","Real","248,278,250,278,251,285,254,286,254,298,238,298,238,288,240,280"];
area_coords194=["poly","Red River","409,114,413,110,430,121,429,137,425,135,409,135"];
area_coords195=["poly","Reeves","95,195,104,207,107,207,110,211,113,211,114,219,129,224,110,249,92,234"];
area_coords196=["poly","Refugio","327,363,334,353,343,346,351,347,355,355,343,357,345,361,338,366,327,363,334,353,327,363,327,363"];
area_coords197=["rect","Roberts","200,20,219,37"];
area_coords198=["poly","Robertson","372,223,372,229,375,239,368,245,368,250,363,251,353,234,362,229"];
area_coords199=["rect","Rockwall","365,153,373,159"];
area_coords200=["rect","Runnels","232,192,249,213"];
area_coords201=["poly","Rusk","438,178,435,180,420,180,420,203,440,203,437,197,434,197,434,190,438,178"];
area_coords202=["poly","Sabine","457,214,459,212,466,214,471,230,455,233,455,222,457,214"];
area_coords203=["poly","San Augustine","441,210,447,210,457,214,455,222,455,233,449,234,444,229,445,216"];
area_coords204=["poly","San Jacinto","408,245,410,243,415,252,419,253,419,257,423,257,425,261,413,268,407,262,407,262,408,245"];
area_coords205=["poly","San Patricio","318,361,338,366,345,377,341,384,333,376,319,371,319,368,316,366,315,363"];
area_coords206=["poly","San Saba","273,219,284,222,291,229,295,234,295,242,273,242"];
area_coords207=["rect","Schleicher","205,236,235,251"];
area_coords208=["rect","Scurry","198,155,215,172"];
area_coords209=["rect","Shackelford","254,154,272,172"];
area_coords210=["poly","Shelby","437,197,455,196,463,207,462,213,459,212,457,214,447,210,441,210,440,203"];
area_coords211=["poly","Sherman","162,1,182,1,182,20,162,20"];
area_coords212=["poly","Smith","398,165,402,169,420,173,420,190,403,190,404,180,399,176"];
area_coords213=["poly","Sovervell","319,181,326,182,325,186,317,191,315,185"];
area_coords214=["poly","Starr","278,421,300,421,289,446,280,440,271,437,268,428,271,429"];
area_coords215=["rect","Stephens","273,154,290,172"];
area_coords216=["poly","Sterling","194,192,210,192,210,209,208,209,208,214,194,214"];
area_coords217=["rect","Stonewall","221,136,239,153"];
area_coords218=["rect","Sutton","205,252,235,269"];
area_coords219=["rect","Swisher","168,76,186,94"];
area_coords220=["rect","Tarrant","328,153,346,171"];
area_coords221=["rect","Taylor","234,173,252,191"];
area_coords222=["poly","Terrell","146,279,146,270,146,269,154,269,154,255,162,255,162,253,179,253,181,257,177,264,180,266,176,270,176,292,164,292,156,287"];
area_coords223=["rect","Terry","147,136,164,154"];
area_coords224=["rect","Throckmorton","259,135,276,153"];
area_coords225=["poly","Titus","416,135,426,135,426,153,421,149,416,150"];
area_coords226=["poly","Tom Green","194,214,208,214,208,209,232,209,232,214,236,214,236,236,215,236,215,216,194,216"];
area_coords227=["poly","Travis","310,255,313,255,320,263,326,260,334,264,330,273,321,281,305,267,310,255,313,255,310,255"];
area_coords228=["poly","Triniity","404,236,421,223,426,233,412,246,410,243,408,245,406,245"];
area_coords229=["poly","Tyler","436,236,440,237,441,236,447,238,448,243,454,254,453,259,436,260,433,238"];
area_coords230=["poly","Upshur","414,157,430,157,430,166,424,171,419,173,414,172"];
area_coords231=["rect","Upton","156,211,175,235"];
area_coords232=["rect","Uvalde","235,298,260,321"];
area_coords233=["poly","Val Verde","181,270,214,270,214,310,210,316,175,292,175,270"];
area_coords234=["poly","Van Zandt","382,158,385,158,389,163,393,163,396,165,398,165,399,176,404,180,382,180"];
area_coords235=["poly","Victoria","349,320,350,322,353,324,360,339,351,343,351,347,343,346,341,332,337,331"];
area_coords236=["poly","Walker","398,241,404,236,406,245,408,245,407,260,398,260,389,253,389,245"];
area_coords237=["poly","Waller","378,272,390,271,391,278,385,276,390,291,384,294,379,286,381,280,377,277"];
area_coords238=["poly","Ward","113,211,114,219,129,224,134,224,137,226,140,226,140,211,138,211,138,210,120,210"];
area_coords239=["poly","Washington","353,275,359,269,372,265,377,266,378,268,379,268,380,272,377,272,376,277,376,279,371,278,359,279,358,276"];
area_coords240=["poly","Webb","232,361,261,361,261,368,283,368,283,400,263,400,262,398,259,401,256,401"];
area_coords241=["poly","Wharton","377,298,380,299,381,303,382,306,384,307,385,311,389,314,389,315,372,327,361,315,372,307,372,303"];
area_coords242=["rect","Wheeler","220,38,239,57"];
area_coords243=["poly","Wichita","277,100,291,102,297,106,297,116,277,116,277,100"];
area_coords244=["poly","Wilbarger","258,92,263,89,269,95,269,100,277,100,277,116,259,116"];
area_coords245=["poly","Willacy","312,428,332,428,332,432,330,435,331,440,328,442,317,439,317,436,312,435"];
area_coords246=["poly","Williamson","318,242,336,249,337,251,341,262,336,263,334,264,326,260,320,263,318,261,313,255,310,255,311,251"];
area_coords247=["poly","Wilson","305,309,317,309,321,315,305,330,297,321,305,309"];
area_coords248=["poly","Winkler","130,192,130,195,120,195,120,210,138,210,138,192"];
area_coords249=["rect","Wise","315,133,333,152"];
area_coords250=["poly","Wood","397,153,414,153,414,172,407,170,402,169,398,165"];
area_coords251=["rect","Yoakum","129,136,146,154"];
area_coords252=["rect","Young","277,135,296,153"];
area_coords253=["poly","Zapata","259,401,262,398,263,400,278,400,278,421,271,429,268,428,259,410"];
area_coords254=["rect","Zavala","235,322,260,340"];
	
county_used=false;
currCounty=0;
tempLeft=0;
tempTop=0;
function getCounty(num,county,coords)
	{
	if (document.getElementById)
		{
		county_used=true;
		currObject='county_popup';
		currCounty=num;
		getXCoord(document.getElementById('county_map'));
		getYCoord(document.getElementById('county_map'));
	
		element = findDOM(currObject,1);
		state = element.visibility;
		html_string=county;
	
		var string_coords=coords.split(",");
		coords_array=new Array();
		coords_array[0]="";
		for (i=0; i<string_coords.length; i++)
			{
   			coords_array[i+1]=Math.floor(string_coords[i]);
 			}

		top_coord_largest=0;
		left_coord_largest=0;
		top_coord_smallest=1000;
		left_coord_smallest=1000;
		for (i=0; i<coords_array.length; i++)
			{
			if (coords_array[i+1]>left_coord_largest)
				{
				left_coord_largest=coords_array[i+1];
				}
			if (coords_array[i+1]<left_coord_smallest)
				{
				left_coord_smallest=coords_array[i+1];
				}
			if (coords_array[i+2]>top_coord_largest)
				{
				top_coord_largest=coords_array[i+2];
				}
			if (coords_array[i+2]<top_coord_smallest)
				{
				top_coord_smallest=coords_array[i+2];
				}
			i++
			}
		element.left=(curleft+left_coord_smallest+Math.floor(left_coord_largest-left_coord_smallest)/2)-Math.floor(html_string.length*4)+2+"px";
		element.top=(curtop+top_coord_smallest+Math.floor(top_coord_largest-top_coord_smallest)/2)-7+"px";
		tempLeft=(left_coord_smallest+Math.floor(left_coord_largest-left_coord_smallest)/2)-Math.floor(html_string.length*4)+2;
	
		document.getElementById('county_title').innerHTML=html_string;
		element.visibility = 'visible';
		prevNum=num;
	
		checkBrowserWidth();
		attachEventListener(window,"resize",checkBrowserWidth,false);
		}
	else
		{
		getOldMessage();
		}
	}

function addLoadListener(fn)
	{
	if (typeof window.addEventListener!='undefined')
		{
		window.addEventListener('load',fn,false);
		}
	else if (typeof document.addEventListener!='undefined')
		{
		document.addEventListener('load',fn,false);
		}
	else if (typeof window.attachEvent!='undefined')
		{
		window.attachEvent('onload',fn);
		}
	else
		{
		return false;
		}
	return true;
	}

function attachEventListener(target,eventType,functionRef,capture)
	{
    if (typeof target.addEventListener!="undefined")
    	{
        target.addEventListener(eventType,functionRef,capture);
    	}
    else if (typeof target.attachEvent!="undefined")
    	{
        target.attachEvent("on"+eventType,functionRef);
    	}
    else
    	{
        return false;
    	}
    return true;
	}
	
curleft=0;
curtop=0;

function getXCoord(obj)
	{
    curleft = 0;
    if (obj.offsetParent)
		{
        while(1) 
        	{
          	curleft += obj.offsetLeft;
          	if(!obj.offsetParent)
				{
            	break;
				}
          	obj = obj.offsetParent;
			}
        }
    else if (obj.x)
		{
        curleft += obj.x;
		}
	return curleft;
	}
	
function getYCoord(obj)
	{
    curtop = 0;
    if (obj.offsetParent)
		{
        while(1)
        	{
          	curtop += obj.offsetTop;
          	if(!obj.offsetParent)
		  		{
            	break;
				}
          	obj = obj.offsetParent;
			}
        }
    else if (obj.y)
		{
        curtop += obj.y;
		}
	return curtop;
	}

browserWidth=0;
prevWidth=0;
function checkBrowserWidth()
	{
	prevWidth=browserWidth;
	browserWidth=getBrowserWidth();
	if (browserWidth==0)
		{
		addLoadListener(checkBrowserWidth);
		return false;
		}
	if (prevWidth!=browserWidth && prevWidth!=0)
		{
		if (currObject!="" || municipality_used==true || county_used==true || birthplace_used==true)
			{
			/*if (popup_used==true)
				{
				element=findDOM('delegate_popup',1);
				element.left=0+"px";
				}*/
			if (municipality_used==true)
				{
				//municipality_popup
				element=findDOM('municipality_popupTitle',1);
				getXCoord(currMunicipality);
				element.left=(curleft-12)+"px";
				
				element=findDOM('municipality_popup',1);
				element.left=(curleft+128)+"px";
				}
			else if (county_used==true)
				{
				element=findDOM('county_popup',1);
				getXCoord(document.getElementById('county_map'));
				element.left=(curleft+tempLeft)+"px";
				}
			else if (birthplace_used==true)
				{
				element_title=findDOM('birthplace_popupTitle',1);
				getXCoord(currBirthplace);
				element_title.left=(curleft-12)+"px";
				
				element = findDOM('birthplace_popup',1);
				element.left=(curleft+118)+"px";
				}
			}
		}
	return true;
	}

function getBrowserWidth()
	{
	if (window.innerWidth)
		{
		return window.innerWidth;
		}
	else if (document.documentElement && document.documentElement.clientWidth!=0)
		{
		return document.documentElement.clientWidth;
		}
	else if (document.body)
		{
		return document.body.clientWidth;
		}
	return 0;
	}