
var teraflexplus = {};


teraflexplus.search = function(){
	
	jQuery('#search_text').focus(function(){
			if(jQuery(this).val()==jQuery(this).attr('defaultValue')) jQuery(this).val('');
		}).blur(function(){
			if(jQuery.trim(jQuery(this).val())=='') jQuery(this).val(jQuery(this).attr('defaultValue'));
	});

	
	jQuery('#search').submit(function(){
		var search = jQuery('#search_text').val();
		
		if(jQuery.trim(search)=='') return false;
		
		var whereto = jQuery('#search input[name=whereto]:checked').val();
		window.location = whereto + search;
		return false;
	});

};



teraflexplus.domready = function(){
	teraflexplus.search();
};

jQuery(document).ready(teraflexplus.domready);



jQuery(document).ready(function(){
    jQuery('#slideshow').flash(
        { 
          //src: '<?php bloginfo('stylesheet_directory'); ?>/slideshow/slideshow.swf',
          src: 'http://www.teraflexplus.com/wp-content/themes/teraflexplus/slideshow/slideshow.swf',
          width: 880,
          height: 300,
          wmode: 'opaque'
          //flashvars: { foo: 'bar', baz: 'zoo' }
        },
        { version: 8 }
    );
    
    jQuery('#content h3').flash(
    		{ 
            //src: '<?php bloginfo('stylesheet_directory'); ?>/sifr/h3.swf',
            src: 'http://www.teraflexplus.com/wp-content/themes/teraflexplus/sifr/h3.swf',
            wmode: 'transparent',
            flashvars: { 
                css: [
                    '* { color: #000000; }',
                    'a { color: #000000; text-decoration: none; }',
                    'a:hover { color: #ea2326; }'
                ].join(' ')
            }
        },
        { version: 8 },
        function(htmlOptions) {
            htmlOptions.flashvars.txt = this.innerHTML;
            this.innerHTML = '<div>'+this.innerHTML+'</div>';
            var alt = jQuery(this.firstChild);
            htmlOptions.height = alt.height()+10;
            htmlOptions.width = alt.width();
            alt.addClass('alt');
            alt.css('display','none');
            jQuery(this)
                .addClass('flash-replaced')
                .prepend(jQuery.fn.flash.transform(htmlOptions));						
        }
        );
    
    
});