/**
 * Teambox
 */
protouch.trikotmanager = function () {



	$("#trikots .item .trikot").hover(
		function(){
			$("#trikots .item").css("z-index",0);
			$(this).find('.details').show();
			$(this).css('background-position','0 0');
			$(this).parent('li').css('z-index',1);
		},
		function(){
			$(this).css('background-position','0 -300px');
			$(this).find('.details').hide();
			$(this).parent('li').css('z-index',0);
		}
	);

	if ( $("#widgetbox").length ){
		$("#widgetbox a").colorbox({innerWidth:"720px",innerHeight:'620px', inline:false,iframe:true,opacity:0.5});
		$("#cboxOverlay").css('background','#f7f7f7');
	}

	if ($("#Protouch_Trikotdesigner_2011_FlexProject").length > 0 && !this.initialized.trikotmanager) {

		var swffile = protouch.settings.trikotdesignerflash;

		/**  * Flashmap  */
		try {
			var playerVersion = swfobject.getFlashPlayerVersion();
			if ((playerVersion.major >= 10) && (typeof(trikotflashvar) == "object")) {

				swfobject.embedSWF(swffile, "Protouch_Trikotdesigner_2011_FlexProject", "1000", "594", "10.0.0", "expressInstall.swf", trikotflashvar , protouch.settings.flashparams, {
							name: "Protouch_Trikotdesigner_2011_FlexProject",
							id: "Protouch_Trikotdesigner_2011_FlexProject"
						});
			}
		}
		catch (e) {
			throw e;
		}

		this.initialized.trikotmanager = true;
	}
	else if ($('#trikot').length > 0 && !this.initialized.trikotmanager) {

		var trikotimageactive = "0";

		$('#trikot a.arrow')
			.click(function(i) {

				var item = $(this).attr('id');

				if ( item == "prev" ){
					trikotimageactive--;
				}else{
					trikotimageactive++;
				}

				if ( trikotimageactive > 2){
					trikotimageactive = 0;
				}
				else if ( trikotimageactive < 0 ){
					trikotimageactive = 2;
				}

				if ($.browser.msie) {
					$('#trikot .trikotimage img:visible').hide();
					$('#trikot .trikotimage #trikot_' + trikotimageactive).show();
				}else{
					$('#trikot .trikotimage img:visible').fadeOut('fast', function(){
						$('#trikot .trikotimage #trikot_' + trikotimageactive).fadeIn('fast');
					});
				}
			});

		this.initialized.trikotmanager = true;
	}
};

