    $(document).ready( function() {

var domain = 'http://' + window.location.hostname + '/';
var base_url = domain;

		$.fn.colorbox.settings.bgOpacity = "0.5";
		$("a.openup").colorbox({width:350, height:270, iframe:true});
		$("a.opendown").colorbox({width:820, height:610, iframe:true});
		$("a.opens").colorbox({width:600, height:400, iframe:true});
		$("a[rel='album']").colorbox({transition:"elastic", contentCurrent:"{current} / {total}"});

		$('a.loader').click(function () {
		  $("#"+($(this).attr('rel'))).html('<p class="loading"> loading......</p>');
		  $("#"+($(this).attr('rel'))).load($(this).attr('href'),function(){
		  //	  $.getScript(base_url+"js/site.js");
		 });
		  return false;
		});		



		$('a.lopt').click(function () {
		  $("#"+($(this).attr('rel'))).html('<p class="loading"> loading......</p>');
		  $("#"+($(this).attr('rel'))).load($(this).attr('href'),function(){
		  //	  $.getScript(base_url+"js/site.js");
		 });
		 $($(this)).remove();
		  return false;
		});		


		$('a.deleted').click(function () {
		  $("#"+($(this).attr('rel'))).html('<p class="loading"> deleting......</p>');

			if (!confirm('Are you sure ?')){ 
				$("#"+($(this).attr('rel'))).html('canceled...').html('');
				return false;
			 }else{
			  $("#"+($(this).attr('rel'))).load($(this).attr('href'),function(){
		  //	  $.getScript(base_url+"js/site.js");
			 });
		 }
		  return false;
		});	


		$('a.addcart').click(function () {
		  $(".mycart").html('<p class="loading"> loading... </p>');
		  $(this).html('<span class="waiting">.. add to cart ..</span>');
		  $(".mycart").hide().load($(this).attr('href'));
		  $(this).html(($(this).attr('title'))+' [+]');
  		 $('#sidecart').text("");

		  return false;
		});		

		$('a.addcarts').live('click', function() {
			  $(".mycart").html('<p class="loading"> loading... </p>');
			  $(this).html('<span class="waiting">.. add to cart ..</span>');
			  $(".mycart").hide().load($(this).attr('href'));
			  $(this).html(($(this).attr('title'))+' [+]');
			  $('#sidecart').text("");

			  return false;
		});


		 $('.options').live('change', function(){
		 var divID = $(this).attr("id");
		//    alert(divID);
		$("a#v_"+divID).attr("href", $('#'+divID).val());
		});


	$('#sidebasket_info').hover(function() {
		$('#cart_opt').slideDown(500);		
	},
	function() {
		setTimeout("$('#cart_opt').slideUp(1000)",5000);
	});

	$('#cart_opt').hide();


	// Expand Panel
	$(".open-panel").click(function(){
		$("div#panel").slideDown("slow");
		$("#panelright").load(base_url+"cartmini.php");
		$("#toggle a").toggle();
	});	
	
	// Collapse Panel
	$(".close-panel").click(function(){
		$("div#panel").slideUp("slow");	
		$("#toggle a").toggle();
	});		
	
	$("#comment").click(function(){
		$(".temphide").show().slideDown("slow");	
	});	

	$(".temphide").hide();


	});

