// JavaScript Document
/*function session(){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="session.php?hme=home"
xmlHttp.onreadystatechange=nextPage
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function nextPage(){

}

function pedsession(){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="session.php?hme=poultry"
xmlHttp.onreadystatechange=nextPage
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function nextPage(){
}*/

function textAreaLimit(limitField, limitCount, limitNum) 
{
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} 
	else {
		limitCount.value = limitNum - limitField.value.length;
	}
//	alert(limitField.value.length+' > '+limitNum);
}


function lookup_calendar(id){
	var span_id = document.getElementById('span_'+id);
	var elem_id = document.getElementById(id);
	span_id.className = 'show_float';
//	alert(span_id.className);
//	alert(id);
}

function accept_lookup(id){
	var span_id = document.getElementById('span_'+id);
	var elem_id = document.getElementById(id);
	var mo = document.getElementById(id+'_m');
	var da = document.getElementById(id+'_d');
	var ye = document.getElementById(id+'_y');

	span_id.className = 'float';
	elem_id.value = ye.value+'-'+mo.value+'-'+da.value;
}

function image_view(url, width, height){
	img = window.open (url, "mywindow","menubar=1,resizable=1,screenX=100,screenY=100,width="+width+",height="+height);
	img.focus();	
}


function show_bird_profile(id)
{
	//alert('hi');
	
		document.getElementById('details').style.display = 'none'
		document.getElementById('showresult').style.display = 'none';
		document.getElementById('offspring').style.display = 'none';
		document.getElementById('siblings').style.display = 'none';
		document.getElementById('gallery').style.display = 'none';
		document.getElementById(id).style.display='block';
	
}

function chicks(bname,id,img)
{
	//alert(bname+bid+img);
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}	
		var url="chicks.php?bname="+bname+"&id="+id+"&image="+img;
		xmlHttp.onreadystatechange=nextPage
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
}
function nextPage()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") 
	{
		document.getElementById('breeds').innerHTML = xmlHttp.responseText
		document.getElementById('breeds').style.display='block'
	}
}

function pedigs(id)
{
	//alert(bname+bid+img);
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}	
		var url="chicks1.php?id="+id;
		xmlHttp.onreadystatechange=nextPage
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
}

function nextPage()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") 
	{
		document.getElementById('breeds').innerHTML = xmlHttp.responseText
		document.getElementById('breeds').style.display='block'
	}
}

function GetXmlHttpObject()
{
var 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;
}// JavaScript Document// JavaScript Document

//drop selection
function dropselect(hidden,object)
{
var hidden=document.getElementsByName(hidden)[0].value;
var obj=document.getElementsByName(object)[0];
    for(i=0;i<=obj.options.length;i++)
    {
        if(obj.options[i].value==hidden)
        {
        obj.selectedIndex=i;
        break;
        }
    }
}

