function ask(msg)	{
	var r=confirm(msg);
	if (r==true)	return true;
	else return false;
}function askme(what){ return window.confirm("Are you sure you wan to delete "+what+"?");}function exampleC(id, text){  var $el = $('#'+id);  $el.val(text);  $el.blur(function () {            var val = $(this).val();            if (val == '') {                $(this).val(text);            }  });          $el.focus(function () {            var val = $(this).val();            if (val == text) {                $(this).val('');            }  });}$(document).ready(function(){        $('.date-pick').datepicker({        dateFormat: "yy-mm-dd",        changeMonth: true,        changeYear: true,        firstDay: 1,        minDate: null,        yearRange: 'c-60:c+0'    });            $('span.search_span').click(function() {    	var id = $(this).attr('id');    	showSearch(id);    });       });function delRecord(id, title) {    if(askme(title)) {        $('#operation').val('del');         $('#operation_id').val(id);         $('form').submit();    }}function soldRecord(id) {    $('#operation').val('sold');     $('#operation_id').val(id);     $('form').submit();}function displayRecord(id) {    $('#operation').val('display');     $('#operation_id').val(id);     $('form').submit();}function dontMissRecord(id) {    $('#operation').val('dont_miss');     $('#operation_id').val(id);     $('form').submit();}function specialRecord(id) {    $('#operation').val('special');     $('#operation_id').val(id);     $('form').submit();}function alterRows(file) {    var positions = '';        $('#sortable tr:not(.odd)').each(function(index) {        positions+=''+this.id+',';    });    var params = {        'cmd': 'set_order',        positions: JSON.stringify(positions)    };    var orderSaved = function (data) {                var values = data.split(/\n/);        if (values[0] != 'OK') {            $('div.history').html('Saving new sorting failed');            $('div.history').show();            return false;        }     };    $.post(''+root_url+'?m=helpers/'+file, params, orderSaved);   }  var hidden = true;function showSearch(hght) {    if (hidden) {        $('div#search').hide('fast',function() {$('div.func').animate({height:"15px"});});        $('#img_ctrl').fadeOut(function () {             $(this).attr('src','../bgnd/back/control_down_blue.png');             $(this).attr('title','show');             $(this).attr('alt','show');             $('#txt_ctrl').html(' show');             $(this).fadeIn();             });        hidden = false;    } else {        $('div.func').animate({height:hght+"px"}, 1000, 'swing', function (){$('div#search').show();});        $('#img_ctrl').fadeOut(function () {             $(this).attr('src','../bgnd/back/control_up_blue.png');             $(this).attr('title','hide');             $(this).attr('alt','hide');             $('#txt_ctrl').html(' hide');             $(this).fadeIn();             });        hidden = true;    }} 



