function retrieveSpecforCollgeOptions(id)
{
    var req;
    var temp=0;           
    var college= document.getElementById('college');
            
    var college_id = college.options[college.selectedIndex].value;
    if(college_id==0)
    {
        document.getElementById('specilization1').options[0]= new Option('Select','0');
    }
   var url="./batchSpecilizationSelection.do?college_id="+college_id;

               
    //Do the Ajax call
    try
    {
        // Firefox, Opera 8.0+, Safari
        req=new XMLHttpRequest();
                                   
    }
    catch (e)
    {
        // Internet Explorer
        try
        {
            req=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            try
            {
                req=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e)
            {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    // req=GetXmlHttpObject();
             
    req.open("POST", url, true);
    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    req.send(college_id);
    req.onreadystatechange =function(){
              
    document.getElementById('specialization_id').options.length = 0;
    if (req.readyState == 4) {
        var textToSplit = req.responseText;      
        var returnElements=textToSplit.split("|");
        if (req.status =="200" | req.status ==200) {                                        // OK response
            document.getElementById('specialization_id').options[0] = new Option("Select", "0");
            for ( var i=1; i<(returnElements .length)+1; i++ ){
                var valueLabelPair = returnElements[i-1].split(",");
                document.getElementById('specialization_id').options[i] = new Option(valueLabelPair[0], valueLabelPair[1]);
            }
        }
    }                 
};
}













var req;
var temp=0;
function retrieveCourse()
{              

    specialization= document.getElementById('specialization_id');
            
    specialization_id = specialization.options[specialization.selectedIndex].value;
    if(specialization_id==0)
    {
        document.getElementById('specilization1').options[0]= new Option('Select','0');
    }
    college_id = college.options[college.selectedIndex].value;	

    url="./courseSelection.do?specialization_id="+specialization_id+"&college_id="+college_id;

    //Do the Ajax call
    try
    {
        // Firefox, Opera 8.0+, Safari
        req=new XMLHttpRequest();
                                   
    }
    catch (e)
    {
        // Internet Explorer
        try
        {
            req=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            try
            {
                req=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e)
            {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    // req=GetXmlHttpObject();
             
    req.open("POST", url, true);
    req.send(null);
    req.onreadystatechange = function(){
    document.getElementById('course_id').options.length = 0;
    if (req.readyState == 4) {
        textToSplit = req.responseText;
        var returnElements=textToSplit.split("|");
        if (req.status =="200") {                                        // OK response
            document.getElementById('course_id').options[0] = new Option("Select", "0");
            for ( var i=1; i<(returnElements .length)+1; i++ ){
                valueLabelPair = returnElements[i-1].split(",");
                document.getElementById('course_id').options[i] = new Option(valueLabelPair[0], valueLabelPair[1]);
            }
        }
    }
}
}

//New Method By Rocks
var req;
var temp=0;
function retrieveBatchCourse()
{              

    specialization= document.getElementById('specialization_id');
            
    specialization_id = specialization.options[specialization.selectedIndex].value;
    if(specialization_id==0)
    {
        document.getElementById('specilization1').options[0]= new Option('- - - - -Select- - - - -','0');
    }
    college_id = college.options[college.selectedIndex].value;	

    url="./batchCourseSelection.do?specialization_id="+specialization_id+"&college_id="+college_id;

    //Do the Ajax call
    try
    {
        // Firefox, Opera 8.0+, Safari
        req=new XMLHttpRequest();
                                   
    }
    catch (e)
    {
        // Internet Explorer
        try
        {
            req=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            try
            {
                req=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e)
            {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    // req=GetXmlHttpObject();
             
    req.open("POST", url, true);
    req.send(null);
    req.onreadystatechange = function(){
    document.getElementById('course_id').options.length = 0;
    if (req.readyState == 4) {
        textToSplit = req.responseText;
        var returnElements=textToSplit.split("|");
        if (req.status =="200") {                                        // OK response
            document.getElementById('course_id').options[0] = new Option("-----Select-----", "0");
            for ( var i=1; i<(returnElements .length)+1; i++ ){
                valueLabelPair = returnElements[i-1].split(",");
                document.getElementById('course_id').options[i] = new Option(valueLabelPair[0], valueLabelPair[1]);
            }
        }
    }
}
}



function GMInstallAmoutCalculation(value,value2)
{

    document.forms[0].action="./GMInstallAmtCal.do?downPerc="+value+"&downpayID="+value2;
    document.forms[0].submit();
}

function Test123()
{
    //alert(document.getElementById('installments').value);
   //alert("./dispalyInstallmentChoice.do?installment="+document.getElementById('installments').value+"&charge="+document.getElementById('install_charge').value);
   document.forms[0].action="./dispalyInstallmentChoice.do?installment="+document.getElementById('installments').value+"&charge="+document.getElementById('install_charge').value;

   document.forms[0].submit();
}


