var LLId; var pause = 0;
function left_load() {
	if(!pause)
		$("#escorts").load('escorts_list.php');
}

function ref_this(obj,url) {
	$.ajax({
			url: url,
			context: document.body,
			success: function(data){
				alert();
				$('#'+obj).html(data);
			}
	});
}

function message(message,title,loading,hght,width) {
	if(!width) var width = 'auto';
	if(!hght) var hght = '200';
	if(loading == 1) {
		$("#message-modal").html('<table><tr><td valign="top"><img src="images/ajax-loader.gif" width="100" height="100"></td><td class="ui-box-msg"><div class="ui-box-hdr middle">'+message+'</div></td></tr></table>');
	} else if(loading == 2){
		$("#message-modal").html('<table><tr><td valign="top"><img src="images/attention_blue_64x64.png" width="64" height="64"></td><td class="ui-box-msg middle">'+message+'</td></tr></table>');
	} else {
		$("#message-modal").html('<div style="text-align: left;">'+message+'</div>');
	}
	$("#message-modal").attr("title", title).dialog({
		autoOpen: false,
		modal: true,
		width: width,
		height: hght,
		show: 'fade',
		hide: 'fade',
		//show: 'slide'
	});
	$("#message-modal").dialog('open');
}

function dialog_url(id,dataSource,title,w,h) {
	$('#'+id).html('<div class="loader"><img src="images/loading.gif" class="loader"></div>');
	$('#'+id).load(dataSource).attr("title", title).dialog({
		modal: true,
		width: w,
		height: h,
		show: 'fade',
		hide: 'fade'
	});
	$('#'+id).dialog('open');
}

function dialog_html(id,html,title,w,h) {
	$('#'+id).html(html);
	$('#'+id).attr("title", title).dialog({
		modal: true,
		width: w,
		height: h
	});
	$("#dialog-modal").show();
}

function dialog_form(id,w,h) {
	$('#'+id).dialog({
		modal: false,
		width: w,
		height: h,
		show: 'fade',
		hide: 'fade'
	});
	$('#'+id).dialog('open');
}

function dialog_confirm(text,code) {
	$('#message-confirm').html(text).dialog({
		autoOpen: true,
		modal: true,
		width: 300,
		height: 250,
		show: 'fade',
		hide: 'fade',
		buttons: {
		"No": function() { $(this).dialog("close"); },
		"Yes": function() { $(this).dialog("close"); eval(code); }
		}
	});
}

function hl(obj,uhl,id) {
	if(!uhl){
		$(obj).css({	backgroundColor: '#07a'});
	} else {
		$(obj).css({backgroundColor: 'transparent'});
	}
}

function clear_form(form) {
	$(':input','#'+form)
	.not(':button, :submit, :reset')
	.val('')
	.removeAttr('checked')
	.removeAttr('selected');
}

jQuery.fn.hint = function (blurClass) {
  if (!blurClass) {
    blurClass = 'blur';
  }

  return this.each(function () {
    // get jQuery version of 'this'
    var $input = jQuery(this),

    // capture the rest of the variable to allow for reuse
      title = $input.attr('title'),
      $form = jQuery(this.form),
      $win = jQuery(window);

    function remove() {
      if ($input.val() === title && $input.hasClass(blurClass)) {
        $input.val('').removeClass(blurClass);
      }
    }

    // only apply logic if the element has the attribute
    if (title) {
      // on blur, set value to title attr if text is blank
      $input.blur(function () {
        if (this.value === '') {
          $input.val(title).addClass(blurClass);
        }
      }).focus(remove).blur(); // now change all inputs to title

      // clear the pre-defined text when form is submitted
      $form.submit(remove);
      $win.unload(remove); // handles Firefox's autocomplete
    }
  });
};

jQuery.fn.flash = function( color, duration ) {
    var current = this.css( 'color' );
    this.animate( { color: 'rgb(' + color + ')' }, duration / 2 );
    this.animate( { color: current }, duration / 2 );
}
