﻿function getLocation()
{
if(geo_position_js.init()){
    geo_position_js.getCurrentPosition(success_callback,error_callback,{enableHighAccuracy:true});
}
}
        
function success_callback(p)
{
	var coordsForm = document.createElement("form");
    coordsForm.method="post" ;
    coordsForm.action = "Locate.aspx";

    var myInput = document.createElement("input");    
    myInput.setAttribute("name", "latitude") ;
    myInput.setAttribute("value", p.coords.latitude);   
    coordsForm.appendChild(myInput);
 
    var myInput2 = document.createElement("input");
    myInput2.setAttribute("name", "longitude") ;
    myInput2.setAttribute("value", p.coords.longitude);
    coordsForm.appendChild(myInput2) ;
     
    document.body.appendChild(coordsForm) ;
    coordsForm.submit();
    document.body.removeChild(coordsForm) ; 
}

function error_callback(p)
{
	//alert('error='+p.message);
}
