function cart_add(p_id,q)  
 {  
	
		 $.ajax({  
	         type: "GET",  
	         dataType: "script",  
	         cache: false,  
	         url: 'ajax.php?action=cart_add&p_id=' + p_id +'&q='+q,  
			
	         timeout: 3000,  
	         error: function (XMLHttpRequest, textStatus, errorThrown) {
				  // typically only one of textStatus or errorThrown 
				  // will have info
				  alert(XMLHttpRequest+' '+textStatus + ' ' +errorThrown);
				  this; // the options for this ajax request
				},  
	         success: function(data) {   
	             // Clear  
				
				$("#yourcart").html(data);
				
				var new_q;
				if (q==0) q=1;
				
				var t=$("#cart_value_"+p_id).html();
				var s= t.indexOf("(")+1;
				var l= t.indexOf(")")-s;
				//alert($("#cart_value_"+p_id).html()+' '+s+' '+t.indexOf(")")+' '+l);
				new_q = t.substr(s,l);
				
				new_q = parseInt(new_q)+parseInt(q);
				
				if (new_q<10){
					new_q_text = '&nbsp;&nbsp;(';
				} else {
					if (new_q<100)
						new_q_text = '(';
					else
						new_q_text = '(';
				}
				var new_q_text = new_q_text+new_q+')';
				$("#cart_value_"+p_id).html(new_q_text);
				
				
				$("#prods_added").css({ top: mouseY-90, left: mouseX-200});
				$("#prods_added").fadeIn("slow");
				
	            // $("#"+sale+id).html('<a class="love_this">You LOVE this</a>');  
	              
	             // Set the selected value  
	            //$("select#county").val(selected);  
	         }  
	     });  
	
 } 
 
 function get_brands(c)  
 {  
	
		 $.ajax({  
	         type: "GET",  
	         dataType: "json",  
	         cache: false,  
	         url: 'ajax.php?action=get_brands&c='+c,  
			
	         timeout: 3000,  
	         error: function (XMLHttpRequest, textStatus, errorThrown) {
				  // typically only one of textStatus or errorThrown 
				  // will have info
				  alert(XMLHttpRequest+' '+textStatus + ' ' +errorThrown);
				  this; // the options for this ajax request
				},  
	         success: function(data) {   
	             // Clear  
				//alert(data);
				$("select#brand_filter option").remove();  
	              
				 $.each(data, function(i, j){  
					if (j.value!='undefined'){
		                var row = "<option value=\"" +  j.value +  "\">" +  j.text +  "</option>";  
						
		                $(row).appendTo("select#brand_filter");  
					}
	             });  
				
				 
	         }  
	     });  
	
 } 

 
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function start_movie(){
	var embed = document.getElementById('embed');
	embed.innerHTML="";
	
	embed.innerHTML="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"309\" height=\"174\"><param name=\"movie\" value=\"images/10012_around_ireland_start.swf\" /> <param name=\"quality\" value=\"high\" /> <embed src=\"images/10012_around_ireland_start.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"309\" height=\"174\"></embed></object>";
}
