// JavaScript Document

var xmlHttp;
var breedStr;
var dropid;

function showHint_HM( str, id )
{

    dropid = id;



    if ( str.length == 0 )
    {
        //			document.getElementById("txtHint").innerHTML="";
        return;
    }
    xmlHttp = GetXmlHttpObject()
    //		renovationCheck( str )
    if ( xmlHttp == null )
    {
        alert ("Your browser does not support AJAX!");
        return;
    }
    var url="ajax_breed.php?a=HM&at="+str+"&sid="+Math.random();
    xmlHttp.onreadystatechange = stateChanged_HM;
    xmlHttp.open( "GET", url, true );
    xmlHttp.send( null );
}

function stateChanged_HM()
{


    var breeds = 0, breedNo = 0, optionBreed = '';
    if ( xmlHttp.readyState == 4 )
    {
        breedStr	= xmlHttp.responseText;
        if ( breedStr.length > 0 )
        {
            //				document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
            document.quickSearch.bt.options.length = 0; 		//=== clear existing options
            optionBreed	= breedStr.split( ':' );		//=== bulid options
            breedNo = optionBreed.length;
            for( i = 0 ; i < breedNo ; i++ )
            {
                kv	= optionBreed[i].split( '=' );
                document.getElementById(dropid).options[i] = new Option( kv[1], kv[0] );
            }
        }
        else { document.quickSearch.bt.options[0] = new Option( '0', 'Breed Not Found' ); }
    }
}

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;
}




function pop_image( str_image )
{ win = window.open(str_image,'','width=600,height=600,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,directories=no,location=no,status=yes'); }
