
	var myrules = {
		'.productDesc' : function(el){
			el.onmouseover = function(){
				box = this.parentNode;
				//box.style.background = "#E8F2F4"
				box.style.border="1px solid #98BFD0"
			}
			el.onmouseout = function(){
				box = this.parentNode;
				//box.style.background = "#FFFFFF"
				box.style.border="1px solid #FFFFFF"
			}
		},
		'.addtocart' : function(el){
			el.onclick = function(el){
				var product = this.parentNode.parentNode
				pid = product.id.substring(7,12);
				addproduct(pid)
			}
			el.onmouseover = function(){
				
				this.style.color = "Black"
			}
			el.onmouseout = function(){
				this.style.color = ""
			}
		},
		'.addtocartbig' : function(el){
			el.onclick = function(el){
				var product = this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
				pid = product.id.substring(7,12);
				addproduct(pid)
	
			}
		},
		'body' : function(el){
			el.onload = function(){
				//loadflash();
			}
		},
		'#dialog_close' : function(el){
			el.onclick = function(){
				WCMS_hide_dialog()
			}
		}
	}


loadflash = function(){
	
	var flashcode = '<object type="application/x-shockwave-flash" data="/themes/original/images/dynamic_slideshow.swf?xmlfile=/themes/original/images.xml" width="790" height="200"><param name="movie" value="/themes/original/images/dynamic_slideshow.swf?xmlfile=/themes/original/images.xml" /><param name="quality" value="low" /><param name="wmode" value="opaque"/> <img src="/themes/original/images/headers/1.jpg" width="790" height="200" alt="" /></object>';

	new Insertion.Top('header', flashcode);
	setrules()
}

addproduct = function(pid){
	//pid = el.id
	el = "productimage_"+pid;
	pimage = $(el).src
	palt = $(el).alt
	
	var url = '/modules/shopping_cart/ajax/add_to.php';
	
	var pars = "item_id="+pid+"&item_desc="+palt;
		
			
			var myAjax = new Ajax.Updater(
			'cartContents', url, 
			{
				method: 'post', 
				parameters: pars, 
				evalScripts: true,
				afterUpdate: highlightCart()
			});
	
	
}

highlightCart = function (){
	new Effect.Highlight('cartContents', { endcolor:'#BCE5FE'}); 
	//urchinTracker ('/quickcart.html');
	pageTracker._trackPageview('/quickcart.html');
	//Element.scrollTo('cartContents')
}

	Behaviour.register(myrules);
