
function petasinsertcalc(urlopen,SpanName){
    ttt='#'+SpanName;
    //type=$('#statiaid').attr('typestar');
//    var go_url="/orderfull.php";
    var rand = Math.random(9999);
   $.ajax({
        type: "GET",
        cache: false,
        async: false,
        ifModified: true,
        url: urlopen,
        data: "&rand="+rand,
        dataType: "html",
        beforeSend: function()
        {
            $(ttt).html("Обновление календаря...")
        },
        success: function(data)
        {
            $(ttt).html(data);
        },
            
        error : function  (x,e)
        {

			if(x.status==0){
			alert('You are offline!!\n Please Check Your Network.');
			}else if(x.status==404){
			alert('Requested URL not found.');
			}else if(x.status==500){
			alert('Internel Server Error.');
			}else if(e=='parsererror'){
			alert('Error.\nParsing JSON Request failed.');
			}else if(e=='timeout'){
			alert('Request Time out.');
			}else {
                            $(ttt).html(x.responseText);
			}

        }            
            
    });
    return false;
}
