
  $(document).ready(function() {
 
	/*

 	$(":checkbox").click(function(){
    	$.ajax({
		   type: "GET",
		   url: "update.php",
		   data: "table=category&fieldname=is_visible&id="+$(this).attr("value")+"&val="+$(this).is(":checked"),
		   dataType: 'html', 
		   success: function(x){
		     //alert( "Data Saved: " + x );
		   }
		 });
	});
	//$(".side_navigation li li > *").hide();	$(".side_navigation li + li > a,#navbar a").click(function(){
		var href_array= $(this).attr('href').split("/");
		var part_num = 0;
		while (part_num < href_array.length) {
			lastPart = href_array[part_num];
			 part_num += 1;
		}
		var str=lastPart.replace(/#/,"");
		//var str=lastPart;
		//$("sub_"+str).load("data.php?id="+str); 
		$("#sub_"+str).load("data.php?id="+str);
		//$("#content").load("catalog.php?category_id="+str);
    });
    */
    $('#billingcopy:checkbox').click(function(){
		$("input[@name='billing_first_name']").val($("input[@name='first_name']").val());
		$("input[@name='billing_last_name']").val($("input[@name='last_name']").val());
		$("input[@name='billing_city']").val($("input[@name='city']").val());
		$("input[@name='billing_state']").val($("input[@name='state']").val());
		$("input[@name='billing_zip']").val($("input[@name='zip']").val());
		$("input[@name='billing_phone']").val($("input[@name='phone']").val());
		$("input[@name='billing_country']").val($("input[@name='country']").val());
		$("input[@name='billing_address']").val($("input[@name='address']").val());
		$("input[@name='billing_address_2']").val($("input[@name='address_2']").val());
		$("input[@name='billing_company']").val($("input[@name='company']").val());
	 });
    $('.links').click( function() {
        $('.stuff').load('do.php?act='+this.value);
    });
 /*  
    $('#form1').submit( function() {
        $('#elm1').load('do.php?act='+$('#elm1').val);
        $('#main_profile_content').val("ya");
        //alert("yo");
    });
  */
    $(".sql").click( function() {
     	if(this.checked){
     		x=1
     	}else{
     		x=0
     	}
        $('.sql').load('do.php?id='+this.id+'&value='+x);
    });
    
    $(".upload").click( function() {
        $('.thumb').load('image.php?product_id='+this.id);
    });    
    $(".image_item").click(function() {
		var changeSrc = $(this).attr("href");
		$("#image_main").attr("src",changeSrc);
	});

     $(".sql_delete").click( function() {
        $('.sql').load('do.php?id='+this.id);
    });
     $(".edit").editable("do.php", {
         indicator : "Saving...",
         tooltip   : 'Click to edit...'
     });
     $(".editable_textarea").editable("do.php", { 
     	 str       : this.value,
         type      : 'textarea',
         submitdate: {_method: "put"},
         cancel    : 'Cancel',
         submit    : 'Save',
         indicator : "<img src='images/indicator.gif'>",
         tooltip   : 'Click to edit...',
		  cssclass : "editable"
     });

  $('.bubbleInfo').each(function () {
    // options
    var distance = 10;
    var time = 250;
    var hideDelay = 500;

    var hideDelayTimer = null;

    // tracker
    var beingShown = false;
    var shown = false;
    
    var trigger = $('.trigger', this);
    var popup = $('.popup', this).css('opacity', 0);

    // set the mouseover and mouseout on both element
    $([trigger.get(0), popup.get(0)]).mouseover(function () {
      // stops the hide event if we move from the trigger to the popup element
      if (hideDelayTimer) clearTimeout(hideDelayTimer);

      // don't trigger the animation again if we're being shown, or already visible
      if (beingShown || shown) {
        return;
      } else {
        beingShown = true;

        // reset position of popup box
        popup.css({
          top: -100,
          left: -33,
          display: 'block' // brings the popup back in to view
        })

        // (we're using chaining on the popup) now animate it's opacity and position
        .animate({
          top: '-=' + distance + 'px',
          opacity: 1
        }, time, 'swing', function() {
          // once the animation is complete, set the tracker variables
          beingShown = false;
          shown = true;
        });
      }
    }).mouseout(function () {
      // reset the timer if we get fired again - avoids double animations
      if (hideDelayTimer) clearTimeout(hideDelayTimer);
      
      // store the timer so that it can be cleared in the mouseover if required
      hideDelayTimer = setTimeout(function () {
        hideDelayTimer = null;
        popup.animate({
          top: '-=' + distance + 'px',
          opacity: 0
        }, time, 'swing', function () {
          // once the animate is complete, set the tracker variables
          shown = false;
          // hide the popup entirely after the effect (opacity alone doesn't do the job)
          popup.css('display', 'none');
        });
      }, hideDelay);
    });
  });
  
  
	

  

 });
jQuery(function() {
jQuery("#suggest").suggest("search.php?category_id=",{
onSelect: function() {}});
});
function clearText(theField){if(theField.defaultValue==theField.value)
theField.value='';}
function addText(theField){if(theField.value=='')
theField.value=theField.defaultValue;}
function setFocus(theField){theField.focus();}
function removeSpaces(string){var tstring="";string=''+string;splitstring=string.split(" ");for(i=0;i<splitstring.length;i++)
tstring+=splitstring[i];return tstring;}

$(function () {});
//$("#maincol").ajaxMultiFileUpload( {ajaxFile: "upload.php", maxNumFiles:5,uploadFolder:"images/upload/", thumbFolder:"images/thumb" } );

  $(document).ready(function() {});
