$(document).ready(function () {
    $('.mini_slider').icgslider({ easingMethod: 'swing', wrapperClass: 'mini_slider_wrapper', itemsToDisplay: 1  });
    $('.banner_slider').icgslider({ easingMethod: 'swing', wrapperClass: 'banner_slider_wrapper', itemsToDisplay: 1  });
    $('.long_slider').icgslider({ easingMethod: 'swing', wrapperClass: 'bottom_slider_wrapper', itemsToDisplay: 3  });
	$('.bottom_twoitem_slider').icgslider({ easingMethod: 'swing', wrapperClass: 'bottom_twoitem_slider_wrapper', itemsToDisplay: 2 });
	$('.bottom_twoitem_bigdate_slider').icgslider({ easingMethod: 'easeInOutQuad', wrapperClass: 'bottom_twoitem_slider_bigdate_wrapper', itemsToDisplay: 2 });

    // ie6 thing for zebra row
    $('.sortable_table tr:odd').addClass('oddRow');

    $('.contact_form input, .contact_form textarea').each(function () {
        var default_value = $(this).prev('label').css('display', 'none').text();
        if (this.value == '')
            this.value = default_value;

        $(this).focus(function () {
            if (this.value == default_value) {
                this.value = '';
            }
        });
        $(this).blur(function () {
            if (this.value == '') {
                this.value = default_value;
            }
        });
    });

    $("img").error(function () {
		$(this).unbind("error").attr("src", "/images/noimage.jpg");
	});
	
	$("a[rel='external']").attr('target','_blank');
	
	// strip out side nav bg
	if($.trim($("#sub_navigation div").text()) == "") 
	{
		$('#sub_navigation').remove();
	}

$('a.play_button.lightbox').click(function(e){
	var myUrl = $(this).attr('href');
	$.getScript('/scripts/flowplayer-3.2.6.min.js', function () {
		$.colorbox({html:"<div id='videoHolder' style='height:400px;'></div>",
			width:'700px',
			innerHeight:'420px',
			onComplete: function(){
			    flowplayer("videoHolder", "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf",
//				flowplayer("videoHolder", "/flash/flowplayer.commercial-3.2.7.swf",
				{
					key: '#@98191ff01d59607d265', 
					clip: {
					url: myUrl, 
					autoPlay: true
					}
				});
			}
		});
	});
	e.preventDefault();	
});


});

function showDetails(url)
{
	$.colorbox({href:url+" div#colorBox_content", maxWidth: '884px'});
}

//**** login

function login() {
    $.colorbox({
            href: "https://secure.icgplc.com",
            initialWidth: "50",
            initialHeight: "50",
            opacity: "1.0",
            innerWidth: "600",
            innerHeight: "373",
            iframe: true,
            close: ""
        });
}


