
function runEffect(selectedEffect, objectId) {
	//most effect types need no options passed by default
	var options = {};
	//check if it's scale, transfer, or size - they need options explicitly set
	if(selectedEffect == 'scale'){  options = {percent: 100}; }
	else if(selectedEffect == 'transfer'){ options = { to: "#button", className: 'ui-effects-transfer' }; }
	else if(selectedEffect == 'size'){ options = { to: {width: 280,height: 185} }; }
	//run the effect
	$("#"+objectId).show(selectedEffect, options, 500, effectCallback(objectId));
};

//callback function to bring a hidden box back
function effectCallback(objectId) {
	setTimeout(function() {
		$("#"+objectId+":visible").removeAttr('style').hide().fadeOut();
	}, 1000);
};


function showDiv(nContainerId, nDivId, selectorsContainerId, selectorDivId, divClass) 
{
	var hwClass = 'd_hw';

	var nContainer = $('#'+nContainerId); 
	nContainer.children().each(function(){
		if ($(this).attr('id') == nDivId) {
			$(this).removeClass('hidden');			
			$(this).addClass('visible');
			//runEffect('scale', $(this).attr('id'));
		}
		else if ($(this).hasClass('visible')) {
			$(this).removeClass('visible');
			$(this).addClass('hidden');
			//$(this).hide();
		}
		if ($(this).hasClass(hwClass)) {
			$(this).removeClass(hwClass);
		}
	});

	if (divClass == '') divClass = 'bloc_mback';
	var inaClass = 'bloc_mbacki';


	var selectorsContainer = $('#'+selectorsContainerId); 
	selectorsContainer.children().each(function(){

		if ($(this).attr('id') == selectorDivId) {	
			$(this).removeClass();
			$(this).addClass(divClass);
		}
		else if ($(this).hasClass(divClass)) {
			$(this).removeClass(divClass);
			$(this).addClass(inaClass);
		}



	});

	var ll = "bloc_ml";
	var lr = "bloc_mr";
	var lli = "bloc_mli";
	var lri = "bloc_mri";
	selectorsContainer.children().children().children().children().children().each(function(){
		//alert($(this).attr('id'));
		if ($(this).attr('id') == selectorDivId && $(this).hasClass(lri)) {	

			$(this).removeClass(lri);
			$(this).addClass(lr);

		}
		else if ($(this).hasClass(lr)) {
			$(this).removeClass(lr);
			$(this).addClass(lri);
		}
	});

	selectorsContainer.children().children().children().children().children().each(function(){
		//alert($(this).attr('id'));
		if ($(this).attr('id') == selectorDivId && $(this).hasClass(lli)) {	
			$(this).removeClass(lli);
			$(this).addClass(ll);

		}
		else if ($(this).hasClass(ll)) {
			$(this).removeClass(ll);
			$(this).addClass(lli);

		}
	});

}


function showVideoDiv(nContainerId, nDivId, selectorsContainerId, selectorDivId, divClass) 
{
	var nContainer = $('#'+nContainerId); 
	nContainer.children().each(function(){
		if ($(this).attr('id') == nDivId) {
			$(this).removeClass('hidden');			
			$(this).addClass('visible');
			//runEffect('scale', $(this).attr('id'));
		}
		else if ($(this).hasClass('visible')) {
			$(this).removeClass('visible');
			$(this).addClass('hidden');
			//$(this).hide();
		}
	});

	if (divClass == '') divClass = 'vactive';
	inaClass = 'vinactive';

	var selectorsContainer = $('#'+selectorsContainerId); 
	selectorsContainer.children().each(function(){
		if ($(this).attr('id') == selectorDivId) {	
			$(this).removeClass();
			$(this).addClass(divClass);
		}
		else if ($(this).hasClass(divClass)) {
			$(this).removeClass(divClass);
			$(this).addClass(inaClass);
		}
	});
}

function showVideoPDiv(nContainerId, nDivId, selectorsContainerId, selectorDivId, divClass) 
{
	var nContainer = $('#'+nContainerId); 
	nContainer.children().each(function(){
		if ($(this).attr('id') == nDivId) {
			$(this).removeClass('hidden');			
			$(this).addClass('visible');
			//runEffect('scale', $(this).attr('id'));
		}
		else if ($(this).hasClass('visible')) {
			$(this).removeClass('visible');
			$(this).addClass('hidden');
			//$(this).hide();
		}
	});
	/*	
	if (divClass == '') divClass = 'vidactive';
	inaClass = 'vidinactive';

	var selectorsContainer = $('#'+selectorsContainerId); 
	selectorsContainer.children().each(function(){
		if ($(this).attr('id') == selectorDivId) {	
			$(this).removeClass();
			$(this).addClass(divClass);
		}
		else if ($(this).hasClass(divClass)) {
			$(this).removeClass(divClass);
			$(this).addClass(inaClass);
		}
	});
	 */
}

function changeID(id,lang)
{
	//alert(id);
	ajaxCallJSON('providers/AddFeature/ajaxChangeCat', { cid : id , clang : lang} , '/' );
	//ajaxCallJSON('providers/AddFeature/ajaxChangeCat', {ldelim} catid : id, lang : '{$lang}' {rdelim} , '/' );
}


function display()
{
	$("td.arg").toggleClass("hidden");
	$("div.arg").toggleClass("hidden");
};

