
function submitform(parameter){
    /*jQuery('#ListLoadingGif').show();
    //if(document.adminForm.boxchecked.value==0){
        //alert('Atzīmējiet kādu no izvēlnēm');
        jQuery("#ListLoadingGif").hide();
        return false;
    }*/

    jQuery("#F_ACTION").val(parameter);
    //alert(parameter);
    document.getElementById('adminForm').submit();
}

function isChecked(isitchecked){
	if (isitchecked == true){
		document.adminForm.boxchecked.value++;
	}
	else {
		document.adminForm.boxchecked.value--;
	}
}
function chkUnlimited(isitchecked){
	if (isitchecked == false){
        jQuery('#imptotal').removeAttr('readonly');
        jQuery('#imptotal').removeClass("readonly");
        //jQuery('#imptotal').addClass("inputbox");
	}else {
        jQuery("#imptotal").attr("readonly","readonly");
        jQuery('#imptotal').addClass("readonly");
        //jQuery('#imptotal').removeClass("inputbox");


	}
}
function jSelectBannerFile(path) {
    jQuery("#ListLoadingGif").show();
	jQuery("#F_WEB_PATH").val(path);
    var dataString = 'path='+path;
	jQuery.ajax({
        type: "GET",
        url: "/console/media_managment/image_for_banner/",
        data: dataString,
        dataType: "xml",
        success: function(xml) {

            jQuery("attels", xml).each(function(i){

                var _message = jQuery("message", this).text();
                var _width = jQuery("width", this).text();
                var _height = jQuery("height", this).text();
                if(_width==-1){jAlert('Banerim nav iespējams iestādīt attēla izmēru!','Paziņojums')}
                jQuery("#bannerImage").html(_message);
                jQuery("#width").val(_width);
                jQuery("#height").val(_height);

            });


        }
    });
    jQuery("#ListLoadingGif").hide();
    SqueezeBox.close();
}

function tableOrdering( order, field, task ) {
	var form = document.adminForm;

	form.F_ORDER.value 	= order;
	form.F_FIELD.value	= field;
    isChecked();
	submitform(task);
}