var $j = jQuery.noConflict();
var jsonVideoCorrelati = null;

/* UNIFORM	*/
$j(function(){
	initUniform();
});

function initUniform() {
	$j("input:text").each(function () {
		if (this.readOnly) {
			$j(this).parents("div.box_Input").addClass("disabled");
		}
	})
}

/* REMOVE INPUT ERROR */
$j(document).ready(function() {
	$j(".box_Error input").focus(function() {
		$j(this).parents(".box_Form_Item").removeClass("box_Error");
		$j(this).parents(".box_Form_Item").find("input").focus();
	});
	$j(".box_Error textarea").focus(function() {
		$j(this).parents(".box_Form_Item").removeClass("box_Error");
	});
	$j(".box_Error input").click(function() {
		$j(this).parents(".box_Form_Item").removeClass("box_Error");
		$j(this).parents(".box_Form_Item").find("input").focus();
	});
	$j(".box_Error textarea").click(function() {
		$j(this).parents(".box_Form_Item").removeClass("box_Error");
		$j(this).parents(".box_Form_Item").find("textarea").focus();
	});
	$j(".box_Error .txt_Error").click(function() {
		$j(this).parents(".box_Form_Item").removeClass("box_Error");
		$j(this).parents(".box_Form_Item").find("input").focus();
	});


	$j(".box_Form_Item .txt_Message").focus(function() {
		$j(this).css("display", "none");
		$j(this).parents(".box_Form_Item").find(".js_Inner_Message").focus();
	});
	$j(".box_Form_Item .js_Inner_Message").focus(function() {
		$j(this).parents(".box_Form_Item").find(".txt_Message").css("display", "none");
	});
	$j(".box_Form_Item .js_Inner_Message").blur(function() { 
		if ($j(this).val() == "") {
			$j(this).parents(".box_Form_Item").find(".txt_Message").css("display", "inline");
		}
	});
});

/* REMOVE VALUE FROM js_Login INPUT	*/
$j(document).ready(function() {
	$j('.js_IL_Element').each(function(index) {
		if ($j(this).val() != "") {
			$j(this).parents(".js_Internal_Label").find("label").removeClass("lbl_Visible");
		}
	});

	$j(".js_Internal_Label .js_IL_Element").focus(function() { 
		$j(this).parents(".js_Internal_Label").find("label").removeClass("lbl_Visible");
	//	$j(this).parents(".js_Description").find(".js_Description_Container").css("display", "none");
	});
	$j(".js_Internal_Label .js_IL_Element").blur(function() { 
		if ($j(this).val() == "") {
			$j(this).parents(".js_Internal_Label").find("label").addClass("lbl_Visible");
		}
	});
	$j(".js_Internal_Label label").click(function() { 
		$j(this).removeClass("lbl_Visible");
		$j(this).parents(".js_Internal_Label").find(".js_IL_Element").focus();
	//	$j(this).parents(".js_Description").find(".js_Description_Container").css("display", "none");
	});
});

/* MENU	*/
function initMenu() {
	$j('.js_SubMenu').live("mouseenter", function (event) {
		$j(this).find(".js_SubMenu_Container").show().css({'z-index': 999});
	});
	$j('.js_SubMenu').live("mouseleave", function (event) {
		$j(this).find(".js_SubMenu_Container").hide().css({'z-index': 1});
	});
}
if ($j.browser.msie && $j.browser.version.substr(0,1)=='6') {
	$j(function() {
		$j('.list_Menu_Main li').hover(function(){
			$j(this).addClass('hover');
		},
		function() {
			$j(this).removeClass('hover');
		});
	});
}


function mostviewed(id,pos){
	$j('#js_StepCarousel_'+id+'_1').addClass('mostviewed_DisplayNone');
	$j('#js_StepCarousel_'+id+'_2').addClass('mostviewed_DisplayNone');
	$j('#js_StepCarousel_'+id+'_3').addClass('mostviewed_DisplayNone');
	$j('#js_StepCarousel_'+id+'_1 div.box_botton_mostviewed a.active').removeClass('active');
	$j('#js_StepCarousel_'+id+'_2 div.box_botton_mostviewed a.active').removeClass('active');
	$j('#js_StepCarousel_'+id+'_3 div.box_botton_mostviewed a.active').removeClass('active');
	$j('#js_StepCarousel_'+id+'_'+pos).removeClass('mostviewed_DisplayNone');
	$j('#js_StepCarousel_'+id+'_'+pos+' div.box_botton_mostviewed li.pos'+pos+' a').addClass('active');	
}



