
// because flash external is so shit, this function needs to be pre-defined
function hph_getXML()
{
//	alert(hph_xml);
//console.log(hph_xml);		
	return hph_xml;
}
function hph_trace(str)
{
//	alert('a');
//	alert(str);
}
function hph_setclickthrough(link,title)
{
	$("a#hph_link_title").attr('href',link);
	$("a#hph_link_title").attr('title',title);
	$("a#hph_link_title").html(title);
	$("a#hph_link").attr('href',link);
	$("a#hph_link").attr('title',title);
}

$(document).ready(function()
			{
				// setup the news marquee
				// =====================================================
				if($('div#bc_news_marquee').length > 0)
				{
					// N E W S   M A R Q U E E
					// **************************************************
					$("div#bc_news_marquee").css('position','absolute');
					var lis = $("div#bc_news_marquee li");
					var lii = 0;
					var liri = 0;
					lis.css('position','absolute');
					lis.each(function()
					{
						var op = $(this);
						op.addClass('marquee_'+lii);
						op.hide();
						lii++;
					});
					// news headline marquee function
					function hl_fade(opli)
					{
						// the op
						var op = $(opli);
						// the current number
						var i = parseInt(op.attr('className').split('_')[1])+1;
						if(i>=lis.length)
						{
							i=0;
						}
						
						// perform the fade
						$(lis[i]).fadeIn(2000,function(){setTimeout(hl_run,4500);});
						op.fadeOut(2000);
					}
					function hl_run()
					{
						hl_fade(lis[liri]);
					
						liri++;
						if(liri>=lis.length)
						{
							liri=0;
						}
					}
					
					// show the first one
					$(lis[0]).show();
					setTimeout(hl_run,5000);
					// **************************************************
				}
				// =====================================================
				
				
				// setup the homepage
				// =====================================================
				if($('div#bc_change_box_cont').length > 0)
				{
					// H E R O   I M A G E   A R E A
					// **************************************************
					var hph_els = $("div#hp_hero_holder ul#hp_heros li");
					var hph_mask = $("div#hp_hero_holder ul#hp_heros li.mask");
					// the xml starter
					hph_xml = '<gallery><conf>';
					// the mask image
					if(hph_mask.length)
					{
						hph_xml += '<mask url="'+$('img',hph_mask).attr('src')+'">true</mask>';
					} else
					{
						hph_xml += '<mask>false</mask>';
					}
					// the lenth of time that the images are displayed for
					hph_xml += '<time>2000</time>';
					// the filter URL
					hph_xml += '<filter>'+$("div#hp_hero_holder ul#hp_heros").attr('title')+'/flash/pixelate.pbj'+'</filter>';
					// the images
					hph_xml += '</conf><images>';
					hph_els.each(function()
								{
									var opli = $(this);
									if(opli.attr('className') != 'mask')
									{
										var opa = $('a',opli);
										var opimg = $('a img',opli);
										hph_xml += '<i img="'+opimg.attr('src')+'" clickthrough="'+opa.attr('href')+'">'+opa.attr('title')+'</i>';	
									}
								});
					// closing the XML
					hph_xml += '</images></gallery>';
					
					function hph_settitle(title,url)
					{
						
					}
					
					$('div#hp_hero_holder').flash(
						{
							src: 'http://brandculture.com.au/wp-content/themes/BC_NEW/flash/hphero.swf',
							width: 745,
							height: 625,
							quality: 'high',
							pluginspage: 'http://www.adobe.com/go/getflashplayer',
							wmode: 'opaque',
							id: 'hphero',
							name: 'hphero',
							bgcolor: '#000000',
							allowScriptAccess: 'sameDomain',
							menu: 'false'
						}, 
						{ 
							version: '10.0.0.0',
							update: true
						}
					);
					
					// **************************************************
					
					
					// L O G O   M A R Q U E E
					// **************************************************
					var lm_lis = $('#bc_ind_prjct_mque div.marquee ul li').clone();
    				function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
    				{
    					var idx = carousel.index(i, lm_lis.length);
    					var op = $(lm_lis[idx - 1]).clone()[0];
    					carousel.add(i, $(op).html());
    					
    					idx = carousel.index(i+1, lm_lis.length);
    					op = $(lm_lis[idx - 1]).clone()[0];
    					carousel.add(i+1, $(op).html());
    					
    					carousel.startAuto();
    				};
					function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
					{
						carousel.remove(i);
					};
					function mycarousel_initCallback(carousel)
					{
					    // Disable autoscrolling if the user clicks the prev or next button.
					    carousel.buttonNext.bind('click', function() {
					        carousel.startAuto(0);
					    });
					
					    carousel.buttonPrev.bind('click', function() {
					        carousel.startAuto(0);
					    });
					
					    // Pause autoscrolling if the user moves with the cursor over the clip.
					    carousel.clip.hover(function() {
					        carousel.stopAuto();
					    }, function() {
					        carousel.startAuto();
					    });
					};
					$('#bc_ind_prjct_mque div.marquee ul').jcarousel({
        				scroll: 1,
        				auto: 2,
        				wrap: 'circular',
        				animation: 1500,
        				itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
        				itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback},
        				initCallback: mycarousel_initCallback
    				});
					// **************************************************
					
					
					// F E A T U R E   N A V I G A T I O N
					// **************************************************
					var ft_items = $("div#bc_change_box_cont ul li");
					ft_items.css('position','absolute');
					ft_items.each(function()
					{
						var op = $(this);
						op.addClass('ft_items_'+lii);
						op.hide();
						lii++;
					});
					$(ft_items[0]).show();
					$(ft_items[0]).addClass('ft_sel');
					$("div#bc_change_box_cont").css('display','block');
					// set up the links to the feature items
					
					$("a[rel=ft_rollover]").hover(function()
													{
														var op = $('li#'+this.className.split(' ')[0]);
														var op_sel = $('li.ft_sel');
														
														op_sel.stop(true,false);
														op_sel.fadeOut(1000);
														op_sel.removeClass('ft_sel');
														
														op.stop(true,true);
														op.fadeIn(1000);
														op.addClass('ft_sel');
														
														return false;
													},function()
													{
														var op = $(ft_items[0]);
														var op_sel = $('li.ft_sel');
														
														op.removeClass('ft_sel');
														
														op_sel.stop(true,true);
														op_sel.fadeOut(1000);
														op_sel.removeClass('ft_sel');
														
														op.stop(true,true);
														op.css('opacity',0);
														op.css('display','block');
														op.fadeTo(1000,1);
														op.addClass('ft_sel');
														
														return false;
													});
					// **************************************************
					
					
					// W H O   S E C T I O N
					// **************************************************
					var who_lefttint = $("#bc_who_left_tint");
					var who_righttint = $("#bc_who_text_cont");
					var who_button = $("#bc_who_rollover a");
					var who_arrow = $("#bc_who_arrow a");
					who_lefttint.css('width','1px');
					who_lefttint.css('left','280px');
					who_lefttint.css('opacity','0');
					who_righttint.css('width','1px');
					who_righttint.css('left','280px');
					who_righttint.css('opacity','0');
					who_button.css('left','60px');
					$("a.who_close").click(function()
					{
							who_righttint.animate(
							{
								width:"1px",
								opacity:"0",
								left:"280px"
							}, 1000, "easeInOutQuad");
							who_lefttint.animate(
							{
								width:"1px",
								opacity:"0",
								left:"280px"
							}, 1000, "easeInOutQuad");
							who_button.animate(
							{
								left:"60px"
							}, 1000, "easeInOutQuad");
							who_button.removeClass('sel');
							who_arrow.animate(
							{
								opacity:"0"
							}, 500, "easeInOutQuad",function()
													{
														$(this).removeClass('open');
														$(this).animate(
														{
															opacity:"1"
														}, 500, "easeInOutQuad");
													});
							$("#bc_who_rollover a")[0].lastToggle=2;
							return false;
					});
					$("#bc_who_rollover a").toggle(function()
													{
														who_righttint.animate(
														{
															width:"250px",
															opacity:"1",
															left:"30px"
														}, 1000, "easeInOutQuad");
														who_lefttint.animate(
														{
															width:"248px",
															opacity:"1",
															left:"-218px"
														}, 1000, "easeInOutQuad");
														who_button.animate(
														{
															left:"-140px"
														}, 1000, "easeInOutQuad");
														who_button.addClass('sel');
														who_arrow.animate(
														{
															opacity:"0"
														}, 200, "easeInOutQuad",function()
																				{
																					$(this).addClass('open');
																					$(this).animate(
																					{
																						opacity:"1"
																					}, 500, "easeInOutQuad");
																				});
													}, function()
													{
														who_righttint.animate(
														{
															width:"1px",
															opacity:"0",
															left:"280px"
														}, 1000, "easeInOutQuad");
														who_lefttint.animate(
														{
															width:"1px",
															opacity:"0",
															left:"280px"
														}, 1000, "easeInOutQuad");
														who_button.animate(
														{
															left:"60px"
														}, 1000, "easeInOutQuad");
														who_button.removeClass('sel');
														who_arrow.animate(
														{
															opacity:"0"
														}, 500, "easeInOutQuad",function()
																				{
																					$(this).removeClass('open');
																					$(this).animate(
																					{
																						opacity:"1"
																					}, 500, "easeInOutQuad");
																				});
													});
													
				}
				// =====================================================
				
				
				
				
				// setup the page thumbnail browser
				// =====================================================
				if($('ul#availableimages').length > 0)
				{
					// variables
					th_gotopos = 0;
					th_playing = false;
					th_isplaying = false;
					th_list = $('ul#availableimages');
					th_position = 0;
					th_items = $('ul#availableimages li').clone();
					var itemwidth = 85;
					var itemlength = th_items.length;
					// th_init indicates the fully initiated state of the page
					var th_init = false;
					
					// loading text
					$("div#js_thumb_cont").append('<div class="preloader" style="position:absolute; top:30px"><img id="throbber_graphic" src="/wp-content/themes/BC_NEW/img/throbber.gif"/> Loading images . . .</div>');
					
					// hide the autoplay and replace it with a throbber
					$('div#js_prev_links').append('<img id="throbber_graphic" src="/wp-content/themes/BC_NEW/img/throbber.gif" style="position:absolute;left:-20px;top:0px;"/>');
					$('a#playtoggle').fadeOut(2);
						
					// set up the number display
					$('p#js_total_numb').text(itemlength);
					
					var th_iterate = function(y,instant)
					{
						if(th_playing)
						{
							return;
						}
					
						var appendpos;
						var position = y ? 1 :  -1;
						var anim_area = y ? -85 : 0;
						
						// set the playing variable
						th_playing = true;
					
						// get the calculated position - only works with normalised boolean iterators at the moment
						th_position = th_normalise(th_position + position);
						
						// add the element to the end based on the directionality
						if(position == 1)
						{
							appendpos = th_normalise(th_position + 4);
							th_list.append($(th_items[appendpos]).clone());
						} else if(position == -1)
						{
							appendpos = th_normalise(th_position - th_items.length);
							th_list.prepend($(th_items[appendpos]).clone());
							th_list.css('left','-'+itemwidth+'px');
						}
						
						// set up and key the animation
						if(instant == true)
						{
							th_list.css('left',anim_area+"px");
							th_callback(true);
						} else
						{
							th_list.animate({"left": anim_area+"px"}, 500,  "easeInOutQuad", th_callback);
						}
					}
					var th_callback = function(instant)
					{
						// set the playing variable
						th_playing = false;
						
						if(th_list.position().left >= 0)
						{
							$('ul#availableimages li').each(function(index)
															{
																if(index>=5)
																{
																	$(this).remove();
																}
															});
						} else
						{
							$('ul#availableimages li').each(function(index)
															{
																if(index==0)
																{
																	$(this).remove();
																}
															});
							th_list.css('left','0px');
						}
						
						// update the thumbnails
						th_updatethumbs();
						
						// check if we need to animate again
						if(th_gotopos > 0)
						{
							th_iterate(0,instant);
							th_gotopos--;
						} else if(th_gotopos < 0)
						{
							th_iterate(1,instant);
							th_gotopos++;
						} else if(!th_init)
						{
							th_init = true;
							//
							$("img#throbber_graphic").fadeOut(1000);
							$('a#playtoggle').fadeIn(1000);
						}
					}
					var th_normalise = function(pos)
					{
						var opt = pos;
					
						if(pos >= th_items.length)
						{
							opt = 0 + (pos - th_items.length);
							opt = th_normalise(opt);
						} else if(pos < 0)
						{
							opt = th_items.length + pos;
							opt = th_normalise(opt);
						}
						
						return opt;
					}
			
					// set up the UL with the original images
					th_list.width(itemwidth*6);
					th_list.empty();
					for(var i=0;i<5;i++)
					{
						th_list.append($(th_items[th_normalise(i)]).clone());
					}
					
					// the image setup functionality
					var th_go = function(li, runmarquee, runimage)
					{
						if(th_playing || li.className.indexOf('sel') != -1)
						{
							return;
						}
						
						// setting up the variables
						var pos = 0;
						var jqa = $('a',li);
						var title = jqa.attr('title');
						var img = jqa.attr('href');
						var description = $('span',li).html();
						var realpos = $(li).attr('id').split('_')[1];
						var imgclass = $('a img',li).attr('className');
						
						// set up the position display
						$('p#js_current_numb').text(1+parseInt(realpos));
						
						// add the selected class to the li element
						$('ul#availableimages li').removeClass('sel');
						$(li).addClass('sel');
						
						// if run marquee switch is not specifically set to false
						if(runmarquee !== false)
						{
							// determine the clicked element's position in the current stack
							$('ul#availableimages li').each(function()
							{
								if($(this).hasClass('sel'))
								{
									return false;
								}
								pos++;
							});
							// potentially animating the marquee to the center
							pos = 2 - pos;
							if(pos !== 0)
							{
								th_gotopos = pos < 0 ? pos+1 : pos-1;
								th_iterate(pos < 0 ? 1 : 0);
							}
						}
						
						// if run image switch is not specifically set to false
						if(runimage !== false)
						{
							// adding the image to the stack and adding the image load listener
							var newhr = $('<img />').appendTo('div#imageholder div').css('display','none').load(function()
								{
//									th_imageslide();
									th_imagefade(this);
								}).attr('src',img);
							$("img#throbber_graphic").fadeIn(500);
						} else
						{
						}
						// setting up the image description
						$('div#js_description_in').html('');
						$('div#js_description_in').append('<h2>'+title+'</h2>');
						$('div#js_description_in').append(description);
						$('#js_filter_holder a').removeClass('js_discipline_live');
						
						if(imgclass)
						{
							$('a#'+imgclass).addClass('js_discipline_live');
						}
					}
					var th_updatethumbs = function()
					{
						var pos = 0;
						$('ul#availableimages li').each(function()
														{
															var $t = $(this);
															$t.removeClass('th_edge');
															$t.removeClass('th_center');
															if(pos == 0 || pos == 4)
															{
																$t.addClass('th_edge');
															} else
															{
																$t.addClass('th_center');
															}
															pos++;
														});
					}
					var th_imageslide = function()
					{
						// set up and key the animation
						$('div#imageholder div').animate({"left": "-930px"}, 2000, "easeInOutQuad", function()
																							{
																								$('div#imageholder div > img:nth-child(1)').remove();
																								$('div#imageholder div').css('left','0px');
																								if(th_isplaying)
																								{
																									setTimeout(th_playpause,3000,true);
																								}
																							});
					}
					var th_imagefade = function(image)
					{
						$("img#throbber_graphic").fadeOut(500);
						$(image).fadeIn("slow", function()
												{
													var me = this;
													$('div#imageholder div img').each(function()
																						{
																							if(this !== me)
																							{
																								$(this).remove();
																							}
																							if(th_isplaying)
																							{
																								setTimeout(th_playpause,3000,true);
																							}
																						});
												});
					}
					// the play / pause toggle
					var th_playpause = function(reissue)
					{
						if((th_isplaying && !reissue) || (!th_isplaying && reissue))
						{
							th_isplaying = false;
						} else
						{
							th_isplaying = true;
							th_go($('ul#availableimages li')[3]);
						}
					}
					
					// set up the initial position
					$(window).load(function()
					{
						// finally, display the image list
						th_list.fadeIn(2000);
//						th_list.css('display','block');

//						$(th_items[0]).trigger('click');
						th_go($('ul#availableimages li')[0], false, false);
						th_gotopos = 1;
						th_iterate(0);
						
						// fade out the preloader text
						$("div#js_thumb_cont div.preloader").fadeOut(2000);
					});
					
					// set up the click callback on the list (propagation)
					th_list.click(function(e)
									{
										th_go(e.target.parentNode.parentNode);
										return false;
									});
					// set up the description toggle
					$('a#desctoggle').click(function(){$('div#js_description').slideToggle('slow'); $('a#desctoggle span.hide').slideToggle('slow'); $('a#desctoggle span.show').slideToggle('slow'); return false;});
					// set up the play/stop toggle
					$('a#playtoggle').click(function(){th_playpause(); $('a#playtoggle span.play').slideToggle('slow'); $('a#playtoggle span.stop').slideToggle('slow'); return false;});
				}
				// =====================================================
				
				
				// setup the other projects thumbnail browser
				// =====================================================
				if($('ul#projectimages').length > 0)
				{
					// variables
					prj_gotopos = 0;
					prj_playing = false;
					th_isplaying = false;
					prj_list = $('ul#projectimages');
					prj_position = 0;
					prj_items = $('ul#projectimages li').clone();
					var itemwidth = 150;
					var itemlength = prj_items.length;
						
					// set up the number display
					$('p#js_total_numb').text(itemlength);
					
					var prj_iterate = function(y)
					{
						if(prj_playing)
						{
							return;
						}
					
						var appendpos;
						var appendage;
						var position = y ? -1 :  1;
						var anim_area = y ? 0 : -150;
						
						// set the playing variable
						prj_playing = true;
					
						// get the calculated position - only works with normalised boolean iterators at the moment
						prj_position = prj_normalise(prj_position + position);
						
						// add the element to the end based on the directionality
						if(position == 1)
						{
							appendpos = prj_normalise(prj_position + 4);
							appendage = $(prj_items[appendpos]).clone();
							prj_list.append(appendage);
							$('a',appendage).hover(function(e)
											{
												prj_title(e.target.parentNode.parentNode);
												return false;
											},function(e)
											{
												prj_untitle();
												return false;
											});
						} else if(position == -1)
						{
							appendpos = prj_normalise(prj_position - prj_items.length);
							appendage = $(prj_items[appendpos]).clone();
							prj_list.prepend(appendage);
							prj_list.css('left','-'+itemwidth+'px');
							$('a',appendage).hover(function(e)
											{
												prj_title(e.target.parentNode.parentNode);
												return false;
											},function(e)
											{
												prj_untitle();
												return false;
											});
						}
						
						// set up and key the animation
						prj_list.animate({"left": anim_area+"px"}, 500,  "easeInOutQuad", prj_callback);
					}
					var prj_callback = function()
					{
						// set the playing variable
						prj_playing = false;
						
						if(prj_list.position().left >= 0)
						{
							$('ul#projectimages li').each(function(index)
															{
																if(index>=3)
																{
																	$(this).remove();
																}
															});
						} else
						{
							$('ul#projectimages li').each(function(index)
															{
																if(index==0)
																{
																	$(this).remove();
																}
															});
							prj_list.css('left','0px');
						}
						
						// update the thumbnails
						prj_updatethumbs();
						
						// check if we need to animate again
						if(prj_gotopos > 0)
						{
							prj_iterate(0);
							prj_gotopos--;
						} else if(prj_gotopos < 0)
						{
							prj_iterate(1);
							prj_gotopos++;
						}
					}
					var prj_normalise = function(pos)
					{
						var opt = pos;
					
						if(pos >= prj_items.length)
						{
							opt = 0 + (pos - prj_items.length);
							opt = prj_normalise(opt);
						} else if(pos < 0)
						{
							opt = prj_items.length + pos;
							opt = prj_normalise(opt);
						}
						
						return opt;
					}
			
					// set up the UL with the original images
					prj_list.width(itemwidth*4);
					prj_list.empty();
					for(var i=0;i<3;i++)
					{
						prj_list.append($(prj_items[prj_normalise(i)]).clone());
					}
					
					// the image setup functionality
					var prj_go = function(li, runmarquee, runimage)
					{
						if(prj_playing || li.className == 'sel')
						{
							return;
						}
						
						// setting up the variables
						var pos = 0;
						var jqa = $('a',li);
						var title = jqa.attr('title');
						var href = jqa.attr('href');
						var realpos = $(li).attr('id').split('_')[1];
						
						// set up the position display
						$('p#js_current_numb').text(1+parseInt(realpos));
						
						// add the selected class to the li element
						$('ul#projectimages li').removeClass('sel');
						$(li).addClass('sel');
						
						// if run marquee switch is not specifically set to false
						if(runmarquee !== false)
						{
							// determine the clicked element's position in the current stack
							$('ul#projectimages li').each(function()
							{
								if($(this).hasClass('sel'))
								{
									return false;
								}
								pos++;
							});
							// potentially animating the marquee to the center
							if(pos !== 0)
							{
								prj_gotopos = pos < 0 ? pos+1 : pos-1;
								prj_iterate(pos < 0 ? 1 : 0);
							}
						}
						
						// setting up the image description
						$('#bc_disc_link_title a').attr('href',href);
						$('#bc_disc_link_title a').html(title);
					}
					var prj_updatethumbs = function()
					{
						var pos = 0;
						$('ul#projectimages li').each(function()
														{
															var $t = $(this);
															$('ul#projectimages li').removeClass('prj_'+pos);
															$t.addClass('prj_'+pos);
															pos++;
														});
					}
					var prj_imageslide = function()
					{
						// set up and key the animation
						$('div#imageholder div').animate({"left": "-930px"}, 2000, "easeInOutQuad", function()
																							{
																								$('div#imageholder div > img:nth-child(1)').remove();
																								$('div#imageholder div').css('left','0px');
																								if(prj_isplaying)
																								{
																									setTimeout(prj_playpause,3000,true);
																								}
																							});
					}
					
					var prj_title = function(li)
					{
						// setting up the variables
						var jqa = $('a',li);
						var title = jqa.attr('title');
						var href = jqa.attr('href');
						
						// add the selected class to the li element
						$('ul#projectimages li').removeClass('sel');
						$(li).addClass('sel');
						
						// setting up the image description
						$('#bc_disc_link_title a').attr('href',href);
						$('#bc_disc_link_title a').html(title);
					}
					var prj_untitle = function()
					{
						var li = $('ul#projectimages li')[0];
						
						prj_title(li);
					}
					
					// set up the initial position
					$(window).load(function()
					{
						prj_updatethumbs();
						prj_go($('ul#projectimages li')[0], false, false);
					});
					
					// set up the click callback on the list (propagation)
					/*
					prj_list.click(function(e)
									{
										prj_go(e.target.parentNode.parentNode);
										return false;
									});
					*/
					$('ul#projectimages li a').hover(function(e)
									{
										prj_title(e.target.parentNode.parentNode);
										return false;
									},function(e)
									{
										prj_untitle();
										return false;
									});
					$('a#marquee_nextlink').click(
													function()
													{
														prj_go($('ul#projectimages li')[1]);
														return false;
													}
												);
				}
				// =====================================================
			});
			
			
			
jQuery.extend( jQuery.easing,
{
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	}
});

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(9($){$.1v.C=9(o){z 4.1b(9(){3p r(4,o)})};8 q={Z:F,25:1,21:1,u:7,1c:3,15:7,1K:\'2X\',2c:\'2Q\',1q:0,B:7,1j:7,1G:7,2F:7,2B:7,2z:7,2x:7,2v:7,2s:7,2p:7,1S:\'<P></P>\',1Q:\'<P></P>\',2m:\'2l\',2k:\'2l\',1O:7,1L:7};$.C=9(e,o){4.5=$.16({},q,o||{});4.Q=F;4.D=7;4.H=7;4.t=7;4.U=7;4.R=7;4.N=!4.5.Z?\'1H\':\'26\';4.E=!4.5.Z?\'24\':\'23\';8 a=\'\',1e=e.K.1e(\' \');1r(8 i=0;i<1e.I;i++){6(1e[i].2y(\'C-2w\')!=-1){$(e).1E(1e[i]);8 a=1e[i];1p}}6(e.2t==\'3o\'||e.2t==\'3n\'){4.t=$(e);4.D=4.t.19();6(4.D.1o(\'C-H\')){6(!4.D.19().1o(\'C-D\'))4.D=4.D.B(\'<P></P>\');4.D=4.D.19()}10 6(!4.D.1o(\'C-D\'))4.D=4.t.B(\'<P></P>\').19()}10{4.D=$(e);4.t=$(e).3h(\'>2o,>2n,P>2o,P>2n\')}6(a!=\'\'&&4.D.19()[0].K.2y(\'C-2w\')==-1)4.D.B(\'<P 3g=" \'+a+\'"></P>\');4.H=4.t.19();6(!4.H.I||!4.H.1o(\'C-H\'))4.H=4.t.B(\'<P></P>\').19();4.R=$(\'.C-11\',4.D);6(4.R.u()==0&&4.5.1Q!=7)4.R=4.H.1z(4.5.1Q).11();4.R.V(4.K(\'C-11\'));4.U=$(\'.C-17\',4.D);6(4.U.u()==0&&4.5.1S!=7)4.U=4.H.1z(4.5.1S).11();4.U.V(4.K(\'C-17\'));4.H.V(4.K(\'C-H\'));4.t.V(4.K(\'C-t\'));4.D.V(4.K(\'C-D\'));8 b=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 c=4.t.32(\'1F\');8 d=4;6(c.u()>0){8 f=0,i=4.5.21;c.1b(9(){d.1I(4,i++);f+=d.S(4,b)});4.t.y(4.N,f+\'T\');6(!o||o.u===J)4.5.u=c.u()}4.D.y(\'1y\',\'1A\');4.U.y(\'1y\',\'1A\');4.R.y(\'1y\',\'1A\');4.2G=9(){d.17()};4.2b=9(){d.11()};4.1U=9(){d.2q()};6(4.5.1j!=7)4.5.1j(4,\'2a\');6($.2A.28){4.1f(F,F);$(27).1u(\'2I\',9(){d.1t()})}10 4.1t()};8 r=$.C;r.1v=r.2H={C:\'0.2.3\'};r.1v.16=r.16=$.16;r.1v.16({1t:9(){4.A=7;4.G=7;4.X=7;4.13=7;4.14=F;4.1d=7;4.O=7;4.W=F;6(4.Q)z;4.t.y(4.E,4.1s(4.5.21)+\'T\');8 p=4.1s(4.5.25);4.X=4.13=7;4.1i(p,F);$(27).22(\'2E\',4.1U).1u(\'2E\',4.1U)},2D:9(){4.t.2C();4.t.y(4.E,\'3u\');4.t.y(4.N,\'3t\');6(4.5.1j!=7)4.5.1j(4,\'2D\');4.1t()},2q:9(){6(4.O!=7&&4.W)4.t.y(4.E,r.M(4.t.y(4.E))+4.O);4.O=7;4.W=F;6(4.5.1G!=7)4.5.1G(4);6(4.5.15!=7){8 a=4;8 b=1k.1P(4.1m()/4.5.15),N=0,E=0;$(\'1F\',4.t).1b(9(i){N+=a.S(4,b);6(i+1<a.A)E=N});4.t.y(4.N,N+\'T\');4.t.y(4.E,-E+\'T\')}4.1c(4.A,F)},3s:9(){4.Q=1h;4.1f()},3r:9(){4.Q=F;4.1f()},u:9(s){6(s!=J){4.5.u=s;6(!4.Q)4.1f()}z 4.5.u},3q:9(i,a){6(a==J||!a)a=i;6(4.5.u!==7&&a>4.5.u)a=4.5.u;1r(8 j=i;j<=a;j++){8 e=4.L(j);6(!e.I||e.1o(\'C-1a-1D\'))z F}z 1h},L:9(i){z $(\'.C-1a-\'+i,4.t)},2u:9(i,s){8 e=4.L(i),20=0,2u=0;6(e.I==0){8 c,e=4.1B(i),j=r.M(i);1n(c=4.L(--j)){6(j<=0||c.I){j<=0?4.t.2r(e):c.1X(e);1p}}}10 20=4.S(e);e.1E(4.K(\'C-1a-1D\'));1R s==\'3l\'?e.3k(s):e.2C().3j(s);8 a=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 b=4.S(e,a)-20;6(i>0&&i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))-b+\'T\');4.t.y(4.N,r.M(4.t.y(4.N))+b+\'T\');z e},1V:9(i){8 e=4.L(i);6(!e.I||(i>=4.A&&i<=4.G))z;8 d=4.S(e);6(i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))+d+\'T\');e.1V();4.t.y(4.N,r.M(4.t.y(4.N))-d+\'T\')},17:9(){4.1C();6(4.O!=7&&!4.W)4.1T(F);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'G\')&&4.5.u!=7&&4.G==4.5.u)?1:4.A+4.5.1c)},11:9(){4.1C();6(4.O!=7&&4.W)4.1T(1h);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'A\')&&4.5.u!=7&&4.A==1)?4.5.u:4.A-4.5.1c)},1T:9(b){6(4.Q||4.14||!4.O)z;8 a=r.M(4.t.y(4.E));!b?a-=4.O:a+=4.O;4.W=!b;4.X=4.A;4.13=4.G;4.1i(a)},1c:9(i,a){6(4.Q||4.14)z;4.1i(4.1s(i),a)},1s:9(i){6(4.Q||4.14)z;6(4.5.B!=\'18\')i=i<1?1:(4.5.u&&i>4.5.u?4.5.u:i);8 a=4.A>i;8 b=r.M(4.t.y(4.E));8 f=4.5.B!=\'18\'&&4.A<=1?1:4.A;8 c=a?4.L(f):4.L(4.G);8 j=a?f:f-1;8 e=7,l=0,p=F,d=0;1n(a?--j>=i:++j<i){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c[a?\'1z\':\'1X\'](e)}c=e;d=4.S(e);6(p)l+=d;6(4.A!=7&&(4.5.B==\'18\'||(j>=1&&(4.5.u==7||j<=4.5.u))))b=a?b+d:b-d}8 g=4.1m();8 h=[];8 k=0,j=i,v=0;8 c=4.L(i-1);1n(++k){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c.I==0?4.t.2r(e):c[a?\'1z\':\'1X\'](e)}c=e;8 d=4.S(e);6(d==0){3f(\'3e: 3d 1H/26 3c 1r 3b. 3a 39 38 37 36 35. 34...\');z 0}6(4.5.B!=\'18\'&&4.5.u!==7&&j>4.5.u)h.33(e);10 6(p)l+=d;v+=d;6(v>=g)1p;j++}1r(8 x=0;x<h.I;x++)h[x].1V();6(l>0){4.t.y(4.N,4.S(4.t)+l+\'T\');6(a){b-=l;4.t.y(4.E,r.M(4.t.y(4.E))-l+\'T\')}}8 n=i+k-1;6(4.5.B!=\'18\'&&4.5.u&&n>4.5.u)n=4.5.u;6(j>n){k=0,j=n,v=0;1n(++k){8 e=4.L(j--);6(!e.I)1p;v+=4.S(e);6(v>=g)1p}}8 o=n-k+1;6(4.5.B!=\'18\'&&o<1)o=1;6(4.W&&a){b+=4.O;4.W=F}4.O=7;6(4.5.B!=\'18\'&&n==4.5.u&&(n-k+1)>=1){8 m=r.Y(4.L(n),!4.5.Z?\'1l\':\'1N\');6((v-m)>g)4.O=v-g-m}1n(i-->o)b+=4.S(4.L(i));4.X=4.A;4.13=4.G;4.A=o;4.G=n;z b},1i:9(p,a){6(4.Q||4.14)z;4.14=1h;8 b=4;8 c=9(){b.14=F;6(p==0)b.t.y(b.E,0);6(b.5.B==\'1Z\'||b.5.B==\'G\'||b.5.u==7||b.G<b.5.u)b.2j();b.1f();b.1M(\'2i\')};4.1M(\'31\');6(!4.5.1K||a==F){4.t.y(4.E,p+\'T\');c()}10{8 o=!4.5.Z?{\'24\':p}:{\'23\':p};4.t.1i(o,4.5.1K,4.5.2c,c)}},2j:9(s){6(s!=J)4.5.1q=s;6(4.5.1q==0)z 4.1C();6(4.1d!=7)z;8 a=4;4.1d=30(9(){a.17()},4.5.1q*2Z)},1C:9(){6(4.1d==7)z;2Y(4.1d);4.1d=7},1f:9(n,p){6(n==J||n==7){8 n=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'A\')||4.5.u==7||4.G<4.5.u);6(!4.Q&&(!4.5.B||4.5.B==\'A\')&&4.5.u!=7&&4.G>=4.5.u)n=4.O!=7&&!4.W}6(p==J||p==7){8 p=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'G\')||4.A>1);6(!4.Q&&(!4.5.B||4.5.B==\'G\')&&4.5.u!=7&&4.A==1)p=4.O!=7&&4.W}8 a=4;4.U[n?\'1u\':\'22\'](4.5.2m,4.2G)[n?\'1E\':\'V\'](4.K(\'C-17-1w\')).1J(\'1w\',n?F:1h);4.R[p?\'1u\':\'22\'](4.5.2k,4.2b)[p?\'1E\':\'V\'](4.K(\'C-11-1w\')).1J(\'1w\',p?F:1h);6(4.U.I>0&&(4.U[0].1g==J||4.U[0].1g!=n)&&4.5.1O!=7){4.U.1b(9(){a.5.1O(a,4,n)});4.U[0].1g=n}6(4.R.I>0&&(4.R[0].1g==J||4.R[0].1g!=p)&&4.5.1L!=7){4.R.1b(9(){a.5.1L(a,4,p)});4.R[0].1g=p}},1M:9(a){8 b=4.X==7?\'2a\':(4.X<4.A?\'17\':\'11\');4.12(\'2F\',a,b);6(4.X!==4.A){4.12(\'2B\',a,b,4.A);4.12(\'2z\',a,b,4.X)}6(4.13!==4.G){4.12(\'2x\',a,b,4.G);4.12(\'2v\',a,b,4.13)}4.12(\'2s\',a,b,4.A,4.G,4.X,4.13);4.12(\'2p\',a,b,4.X,4.13,4.A,4.G)},12:9(a,b,c,d,e,f,g){6(4.5[a]==J||(1R 4.5[a]!=\'2h\'&&b!=\'2i\'))z;8 h=1R 4.5[a]==\'2h\'?4.5[a][b]:4.5[a];6(!$.2W(h))z;8 j=4;6(d===J)h(j,c,b);10 6(e===J)4.L(d).1b(9(){h(j,4,d,c,b)});10{1r(8 i=d;i<=e;i++)6(i!==7&&!(i>=f&&i<=g))4.L(i).1b(9(){h(j,4,i,c,b)})}},1B:9(i){z 4.1I(\'<1F></1F>\',i)},1I:9(e,i){8 a=$(e).V(4.K(\'C-1a\')).V(4.K(\'C-1a-\'+i));a.1J(\'2V\',i);z a},K:9(c){z c+\' \'+c+(!4.5.Z?\'-2U\':\'-Z\')},S:9(e,d){8 a=e.2g!=J?e[0]:e;8 b=!4.5.Z?a.1x+r.Y(a,\'2f\')+r.Y(a,\'1l\'):a.2e+r.Y(a,\'2d\')+r.Y(a,\'1N\');6(d==J||b==d)z b;8 w=!4.5.Z?d-r.Y(a,\'2f\')-r.Y(a,\'1l\'):d-r.Y(a,\'2d\')-r.Y(a,\'1N\');$(a).y(4.N,w+\'T\');z 4.S(a)},1m:9(){z!4.5.Z?4.H[0].1x-r.M(4.H.y(\'2T\'))-r.M(4.H.y(\'2S\')):4.H[0].2e-r.M(4.H.y(\'2R\'))-r.M(4.H.y(\'3i\'))},2P:9(i,s){6(s==J)s=4.5.u;z 1k.2O((((i-1)/s)-1k.2N((i-1)/s))*s)+1}});r.16({3m:9(d){z $.16(q,d||{})},Y:9(e,p){6(!e)z 0;8 a=e.2g!=J?e[0]:e;6(p==\'1l\'&&$.2A.28){8 b={\'1y\':\'1A\',\'2M\':\'2L\',\'1H\':\'1q\'},1Y,1W;$.29(a,b,9(){1Y=a.1x});b[\'1l\']=0;$.29(a,b,9(){1W=a.1x});z 1W-1Y}z r.M($.y(a,p))},M:9(v){v=2K(v);z 2J(v)?0:v}})})(3v);',62,218,'||||this|options|if|null|var|function||||||||||||||||||||list|size||||css|return|first|wrap|jcarousel|container|lt|false|last|clip|length|undefined|className|get|intval|wh|tail|div|locked|buttonPrev|dimension|px|buttonNext|addClass|inTail|prevFirst|margin|vertical|else|prev|callback|prevLast|animating|visible|extend|next|circular|parent|item|each|scroll|timer|split|buttons|jcarouselstate|true|animate|initCallback|Math|marginRight|clipping|while|hasClass|break|auto|for|pos|setup|bind|fn|disabled|offsetWidth|display|before|block|create|stopAuto|placeholder|removeClass|li|reloadCallback|width|format|attr|animation|buttonPrevCallback|notify|marginBottom|buttonNextCallback|ceil|buttonPrevHTML|typeof|buttonNextHTML|scrollTail|funcResize|remove|oWidth2|after|oWidth|both|old|offset|unbind|top|left|start|height|window|safari|swap|init|funcPrev|easing|marginTop|offsetHeight|marginLeft|jquery|object|onAfterAnimation|startAuto|buttonPrevEvent|click|buttonNextEvent|ol|ul|itemVisibleOutCallback|reload|prepend|itemVisibleInCallback|nodeName|add|itemLastOutCallback|skin|itemLastInCallback|indexOf|itemFirstOutCallback|browser|itemFirstInCallback|empty|reset|resize|itemLoadCallback|funcNext|prototype|load|isNaN|parseInt|none|float|floor|round|index|swing|borderTopWidth|borderRightWidth|borderLeftWidth|horizontal|jcarouselindex|isFunction|normal|clearTimeout|1000|setTimeout|onBeforeAnimation|children|push|Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|alert|class|find|borderBottomWidth|append|html|string|defaults|OL|UL|new|has|unlock|lock|10px|0px|jQuery'.split('|'),0,{}));

/**
 * Flash (http://jquery.lukelutman.com/plugins/flash)
 * A jQuery plugin for embedding Flash movies.
 * 
 * Version 1.0
 * November 9th, 2006
 *
 * Copyright (c) 2006 Luke Lutman (http://www.lukelutman.com)
 * Dual licensed under the MIT and GPL licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/gpl-license.php
 * 
 * Inspired by:
 * SWFObject (http://blog.deconcept.com/swfobject/)
 * UFO (http://www.bobbyvandersluis.com/ufo/)
 * sIFR (http://www.mikeindustries.com/sifr/)
 * 
 * IMPORTANT: 
 * The packed version of jQuery breaks ActiveX control
 * activation in Internet Explorer. Use JSMin to minifiy
 * jQuery (see: http://jquery.lukelutman.com/plugins/flash#activex).
 *
 **/ 
;(function(){
	
var $$;

/**
 * 
 * @desc Replace matching elements with a flash movie.
 * @author Luke Lutman
 * @version 1.0.1
 *
 * @name flash
 * @param Hash htmlOptions Options for the embed/object tag.
 * @param Hash pluginOptions Options for detecting/updating the Flash plugin (optional).
 * @param Function replace Custom block called for each matched element if flash is installed (optional).
 * @param Function update Custom block called for each matched if flash isn't installed (optional).
 * @type jQuery
 *
 * @cat plugins/flash
 * 
 * @example $('#hello').flash({ src: 'hello.swf' });
 * @desc Embed a Flash movie.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { version: 8 });
 * @desc Embed a Flash 8 movie.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { expressInstall: true });
 * @desc Embed a Flash movie using Express Install if flash isn't installed.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { update: false });
 * @desc Embed a Flash movie, don't show an update message if Flash isn't installed.
 *
**/
$$ = jQuery.fn.flash = function(htmlOptions, pluginOptions, replace, update) {
	
	// Set the default block.
	var block = replace || $$.replace;
	
	// Merge the default and passed plugin options.
	pluginOptions = $$.copy($$.pluginOptions, pluginOptions);
	
	// Detect Flash.
	if(!$$.hasFlash(pluginOptions.version)) {
		// Use Express Install (if specified and Flash plugin 6,0,65 or higher is installed).
		if(pluginOptions.expressInstall && $$.hasFlash(6,0,65)) {
			// Add the necessary flashvars (merged later).
			var expressInstallOptions = {
				flashvars: {  	
					MMredirectURL: location,
					MMplayerType: 'PlugIn',
					MMdoctitle: jQuery('title').text() 
				}					
			};
		// Ask the user to update (if specified).
		} else if (pluginOptions.update) {
			// Change the block to insert the update message instead of the flash movie.
			block = update || $$.update;
		// Fail
		} else {
			// The required version of flash isn't installed.
			// Express Install is turned off, or flash 6,0,65 isn't installed.
			// Update is turned off.
			// Return without doing anything.
			return this;
		}
	}
	
	// Merge the default, express install and passed html options.
	htmlOptions = $$.copy($$.htmlOptions, expressInstallOptions, htmlOptions);
	
	// Invoke $block (with a copy of the merged html options) for each element.
	return this.each(function(){
		block.call(this, $$.copy(htmlOptions));
	});
	
};
/**
 *
 * @name flash.copy
 * @desc Copy an arbitrary number of objects into a new object.
 * @type Object
 * 
 * @example $$.copy({ foo: 1 }, { bar: 2 });
 * @result { foo: 1, bar: 2 };
 *
**/
$$.copy = function() {
	var options = {}, flashvars = {};
	for(var i = 0; i < arguments.length; i++) {
		var arg = arguments[i];
		if(arg == undefined) continue;
		jQuery.extend(options, arg);
		// don't clobber one flash vars object with another
		// merge them instead
		if(arg.flashvars == undefined) continue;
		jQuery.extend(flashvars, arg.flashvars);
	}
	options.flashvars = flashvars;
	return options;
};
/*
 * @name flash.hasFlash
 * @desc Check if a specific version of the Flash plugin is installed
 * @type Boolean
 *
**/
$$.hasFlash = function() {
	// look for a flag in the query string to bypass flash detection
	if(/hasFlash\=true/.test(location)) return true;
	if(/hasFlash\=false/.test(location)) return false;
	var pv = $$.hasFlash.playerVersion().match(/\d+/g);
	var rv = String([arguments[0], arguments[1], arguments[2]]).match(/\d+/g) || String($$.pluginOptions.version).match(/\d+/g);
	for(var i = 0; i < 3; i++) {
		pv[i] = parseInt(pv[i] || 0);
		rv[i] = parseInt(rv[i] || 0);
		// player is less than required
		if(pv[i] < rv[i]) return false;
		// player is greater than required
		if(pv[i] > rv[i]) return true;
	}
	// major version, minor version and revision match exactly
	return true;
};
/**
 *
 * @name flash.hasFlash.playerVersion
 * @desc Get the version of the installed Flash plugin.
 * @type String
 *
**/
$$.hasFlash.playerVersion = function() {
	// ie
	try {
		try {
			// avoid fp6 minor version lookup issues
			// see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
			var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
			try { axo.AllowScriptAccess = 'always';	} 
			catch(e) { return '6,0,0'; }				
		} catch(e) {}
		return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
	// other browsers
	} catch(e) {
		try {
			if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
				return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
			}
		} catch(e) {}		
	}
	return '0,0,0';
};
/**
 *
 * @name flash.htmlOptions
 * @desc The default set of options for the object or embed tag.
 *
**/
$$.htmlOptions = {
	height: 240,
	flashvars: {},
	pluginspage: 'http://www.adobe.com/go/getflashplayer',
	src: '#',
	type: 'application/x-shockwave-flash',
	width: 320		
};
/**
 *
 * @name flash.pluginOptions
 * @desc The default set of options for checking/updating the flash Plugin.
 *
**/
$$.pluginOptions = {
	expressInstall: false,
	update: true,
	version: '6.0.65'
};
/**
 *
 * @name flash.replace
 * @desc The default method for replacing an element with a Flash movie.
 *
**/
$$.replace = function(htmlOptions) {
	this.innerHTML = '<div class="alt">'+this.innerHTML+'</div>';
	jQuery(this)
		.addClass('flash-replaced')
		.prepend($$.transform(htmlOptions));
};
/**
 *
 * @name flash.update
 * @desc The default method for replacing an element with an update message.
 *
**/
$$.update = function(htmlOptions) {
	var url = String(location).split('?');
	url.splice(1,0,'?hasFlash=true&');
	url = url.join('');
	if(confirm('The Brandculture website requires the latest version of flash player. Click okay to get it now.'))
	{
		window.open('http://www.adobe.com/go/getflashplayer');
	}
//	var msg = '<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="'+url+'">Click here.</a></p>';
//	this.innerHTML = '<span class="alt">'+this.innerHTML+'</span>';
//	jQuery(this)
//		.addClass('flash-update')
//		.prepend(msg);
};
/**
 *
 * @desc Convert a hash of html options to a string of attributes, using Function.apply(). 
 * @example toAttributeString.apply(htmlOptions)
 * @result foo="bar" foo="bar"
 *
**/
function toAttributeString() {
	var s = '';
	for(var key in this)
		if(typeof this[key] != 'function')
			s += key+'="'+this[key]+'" ';
	return s;		
};
/**
 *
 * @desc Convert a hash of flashvars to a url-encoded string, using Function.apply(). 
 * @example toFlashvarsString.apply(flashvarsObject)
 * @result foo=bar&foo=bar
 *
**/
function toFlashvarsString() {
	var s = '';
	for(var key in this)
		if(typeof this[key] != 'function')
			s += key+'='+encodeURIComponent(this[key])+'&';
	return s.replace(/&$/, '');		
};
/**
 *
 * @name flash.transform
 * @desc Transform a set of html options into an embed tag.
 * @type String 
 *
 * @example $$.transform(htmlOptions)
 * @result <embed src="foo.swf" ... />
 *
 * Note: The embed tag is NOT standards-compliant, but it 
 * works in all current browsers. flash.transform can be
 * overwritten with a custom function to generate more 
 * standards-compliant markup.
 *
**/
$$.transform = function(htmlOptions) {
	htmlOptions.toString = toAttributeString;
	if(htmlOptions.flashvars) htmlOptions.flashvars.toString = toFlashvarsString;
	return '<embed ' + String(htmlOptions) + '/>';		
};

/**
 *
 * Flash Player 9 Fix (http://blog.deconcept.com/2006/07/28/swfobject-143-released/)
 *
**/
if (window.attachEvent) {
	window.attachEvent("onbeforeunload", function(){
		__flash_unloadHandler = function() {};
		__flash_savedUnloadHandler = function() {};
	});
}
	
})();