var flash_id=0
function setFlId(el)
{
 if(el.id.indexOf("flash_id")==0)
  return el.id
 flash_id++
 el.id = "flash_id"+flash_id
 return el.id
}
function setSO(id,swfName,w,h,txt)
{
 if(id==null)
  return
 var so=new SWFObject('imgs/'+swfName+".swf",null,w,h,8)
 so.addVariable("txt",txt)
 so.write(id)
}


var rules={

'.fl_hdr': function(el)
{
 var txt=el.firstChild.innerHTML.split(" #")
 var w=txt[1] || 120
 setSO(setFlId(el),"hdr",w,24,txt[0])
},
'div.subtitle': function(el){ setSO(setFlId(el),"hdr",200,24,el.innerHTML) },
'.prod .price': function(el){ setSO(setFlId(el),"pr",94,45,el.innerHTML) },
'.also .price': function(el){ setSO(setFlId(el),"pr",94,45,el.innerHTML) },
'#fl_top': function(el)
{
 var so = new SWFObject("imgs/top.swf", null,900,247,5)
 so.addVariable("links_xml", "swflinks.php")
 so.addParam("quality","medium")
 if(el.title!=null)
  so.addVariable("active", el.title)
 so.write("fl_top")
},
'.nav_top img': function(el)
{
 if(!this.src)
  return
 var nm
 el.onmouseover=function(){ nm=this.src.split(".gif");this.src=nm[0]+"_selected.gif" }
 el.onmouseout=function(){ nm=this.src.split("_selected.gif");this.src=nm[0]+".gif" }
},
'.nav_top a.selected img': function(el){ el.onmouseover=null;el.onmouseout=null },
'.prod': function(el)
{
 el.onmouseover=function(){ this.style.borderColor="#487b10" }
 el.onmouseout=function(){ this.style.borderColor="" }
},

'#big_pic img':function(el)
 {
  el.onmouseover=function()
	{ document.getElementById("big_pic").style.backgroundImage="url(imgs/"+this.id+".jpg)" }
 },

'.center_col div.testimonials div': function(el)
 {
  el.onmouseover = function()
	{this.style.border="solid #CCCCCC 1px";this.style.background="#FAFAFA"}
  el.onmouseout = function()
	{this.style.border="dotted #CCCCCC 1px";this.style.background="#FFFFFF"}
 },

'div.news tr': function(el)
 {
  el.onmouseover=function(){ this.parentNode.parentNode.className="hover" }
  el.onmouseout=function(){ this.parentNode.parentNode.className="" }
 }

}
document.Behaviour.register(rules)

