/*
 * Fray'z
 * 2008
 */

$(document).ready(function()
{

	if($(".mbutton_toggle")[0]){
	$(".mbutton_toggle").click(function() {

			$(this).parent().parent().find(".menu_box_unit_c").toggle();
			$(this).toggleClass("rbutton_up");
			$(this).toggleClass("rbutton_down");

			$(this).parent().parent().toggleClass("menu_box_unit_closed");
			$(this).parent().parent().find(".menu_box_unit_b").toggle();
	});
	}

	if($(".rtext")[0]){
	$(".rtext").click(function() {

			$(this).parent().parent().find(".r_panel_box_unit_c").toggle();
			$(this).parent().find(".rbutton_toggle").toggleClass("rbutton_up");
			$(this).parent().find(".rbutton_toggle").toggleClass("rbutton_down");

			$(this).parent().parent().toggleClass("r_panel_box_unit_closed");
	});
	}

	if($(".rbutton_toggle")[0]){
	$(".rbutton_toggle").click(function() {

			$(this).parent().parent().find(".r_panel_box_unit_c").toggle();
			$(this).toggleClass("rbutton_up");
			$(this).toggleClass("rbutton_down");

			$(this).parent().parent().toggleClass("r_panel_box_unit_closed");
	});
	}

	if($(".cbutton_toggle")[0]){
	$(".cbutton_toggle").click(function() {

			$(this).parent().parent().find(".led").toggleClass("led_closed");
			$(this).parent().parent().find("#column_adv_u").toggleClass("column_adv_u_closed");
			$(this).parent().parent().find(".column_adv_header").toggle();
			$(this).parent().parent().find(".column_adv_content_text").toggle();
			$(this).parent().parent().toggleClass("column_adv_closed");
	})
	}

	if($("tr")[0]){
	$("tr:nth-child(odd)").addClass("oddrow");
	}

	if($("#topline")[0]){
		$("#topline").scrollable({ 
        
		size:5,
        interval: 10000, 
        loop: true,  
        speed: 600, 
		keyboard: false,
		easing:	'swing',
		hoverClass: 'topline_hov',
        onBeforeSeek: function() { 
			if(!jQuery.browser.msie)
            	this.getItems().fadeTo(500, 0.5); 
        }, 
        onSeek: function() { 
            if(!jQuery.browser.msie)
				this.getItems().fadeTo(500, 1);
        } 
    	}).unmousewheel();; 
		
	}

	if($("#player1")[0]){
	$(".playlist").scrollable({size: 3,vertical:true,next:'a.down',prev:'a.up'});

	$(".clips a").click(function() {
        $(this).fadeOut().fadeIn();
    });

	$f("player1", "/flowplayer/flowplayer-3.0.5.swf",  {

	   clip:
	   		{
				scaling:'fit'
			},

	   canvas:
	   		{
				backgroundColor: '#000000',
				backgroundGradient: 'none'
			},

	   play: {
	   		opacity: 1,
            label: null,
            replayLabel: 'Åù¸ ðàç'
       },

	   plugins:  {
        controls: {

			backgroundColor: 'transparent',
            fullscreen:true,
            backgroundGradient: 'none',

            all:false,
            scrubber:true,
			volume:true,
            play:true,
            mute:true,
			playlist:false,

            bufferColor: '#333333',
            progressColor: '#cc0000',
            buttonColor: '#cc0000',
            buttonOverColor: '#000000',

            height: 30,

            autoHide: 'always',

            width: '98%',
            bottom: 5,
            left: '50%',
            borderRadius: 15

        }
       }

     }).playlist("div.mainplayer", {scaling:'fit', loop:false});
	
	}
	
	if($("a.player_centered")[0]){
		
	$f("a.player_centered", "/flowplayer/flowplayer-3.0.5.swf",  { 
	   
	   clip:
	   		{
				scaling:'fit',
				autoPlay: true,
				autoBuffering: true
			},
		
	   canvas:
	   		{
				backgroundColor: '#000000',
				backgroundGradient: 'none'
			},
	   
	   play: { 
	   		opacity: 1,
            label: null,
            replayLabel: 'Åù¸ ðàç' 
       },
	   
	   plugins:  { 
        controls: {             
            
			backgroundColor: 'transparent',
            fullscreen:true,
            backgroundGradient: 'none', 

            all:false, 
            scrubber:true, 
			volume:true,
            play:true, 
            mute:true,
			playlist:false, 
             
            bufferColor: '#333333', 
            progressColor: '#cc0000',             
            buttonColor: '#cc0000', 
            buttonOverColor: '#000000', 
			sliderColor:'#cc0000',
             
            height: 30, 
             
            autoHide: 'always', 

            width: '98%',  
            bottom: 5, 
            left: '50%', 
            borderRadius: 15 
             
        } 
       } 
		
     });
	
	}

});