function setPaginatorCenter(parentDiv, controlDiv, baseName){

	var totalWidth = parseInt($(parentDiv).css('width').replace('px', ''));
		
		var contentWidth = parseInt($(controlDiv).css('width').replace('px', ''));
		
		var marginSize = (totalWidth - contentWidth) / 2 ;
		
		//var itemsWidth = 0;
		
		//alert(parentDiv + ' ' + totalWidth + ' ' + contentWidth );
		//alert(totalWidth + ' - ' + contentWidth + ' - ' + marginSize);
		
		newWidth = (contentWidth + marginSize) + 'px';
		//alert(marginSize);
		$(controlDiv).css('marginLeft', marginSize + 'px');
	}

$(document).ready(function() {

	/** FUNCTION FOR NEW RECOMMEND FOR VIDEOS **/
	$('#recommendBlog').click(function()
	{
		ajaxHyperlink($('#recommendBlog').attr('rel'), $('#recommendBlog').attr('href'));
		$('.videoFrame').css('display', 'none');
		$('.videoNav').css('display', 'none');
		$('#videoInfo').css('display', 'none');
		$('#tableEmbed').css('display', 'none');
		
		initAddChannelForm();
	});
	/** END OF FUNCTION **/
	
	$('#showDesc').click(function()
			{
				$('#button').hide('slow');
				$('#rest').fadeIn('slow');
				$('#button2').show('slow');
				return false;
			}
	);
	
	$('#hideDesc').click(function()
			{
				$('#button2').hide('slow'); 
				$('#rest').fadeOut('slow'); 
				$('#button').show('slow'); 
				return false;
			}
	);
	
	
	$('#addChannel').click(function()
			{
				$('#add_channel').toggle();
				return false;
			}	
	);
	
	$('#adminDebugLink').click(function()
			{
				$('#videoAdminContent').toggle();
				return false;
			}	
	);

	$('#adminOfflineLink').click(function()
			{
				$('#videoAdminOffline').toggle();
				return false;
			}	
	);
	
	$('#selectAllCheckbox').click(function()
			{
				$("input.takedownFormCheckbox").each(function(){
					$(this).attr('checked', true);	
				});
				$('#selectAllCheckbox').toggle();
				$('#deselectAllCheckbox').toggle();
				return false;
			}	
	);

	$('#deselectAllCheckbox').click(function()
			{
				$("input.takedownFormCheckbox").each(function(){
					$(this).attr('checked', false);	
				});
				$('#deselectAllCheckbox').toggle();
				$('#selectAllCheckbox').toggle();
				return false;
			}	
	);

	$('input:radio[name="reason"]').change(function()
		{
			//alert($('input:radio[name=reason]:checked').val());
			if($('input:radio[name=reason]:checked').val() == '5')
			{
				$("#reasonText").attr('disabled', false);
			}
			else
			{
				$("#reasonText").attr('disabled', true);
			}
			
			return false;
		}	
	);
	
	$('input:radio[name="reasonNotOk"]').change(function()
		{
			if($('input:radio[name=reasonNotOk]:checked').val() == '5')
			{
				$("#reasonNotOkText").attr('disabled', false);
			}
			else
			{
				$("#reasonNotOkText").attr('disabled', true);
			}
			
			return false;
		}	
	);
		
	$('#AdminOfChannels').change(function()
		{	
			changeSelectbox('postAsUserContainer', '/video/userlist/id/'+ $('#AdminOfChannels').val());
		}
	);
	
	
	$('#notokBtn').click(function() {

		$('#notOkForm').toggle("slow");
		
		return false;
	});
	
	
	
	/** fill search bar **/
	$('#searchparam').val('Search...');
	
	$('#searchparam').focus(function()
		{
			if($('#searchparam').val() == 'Search...')
			{
				$('#searchparam').val('');
			}
		});
	
	$('#searchparam').blur(function()
		{
			if($('#searchparam').val() == '')
			{
				$('#searchparam').val('Search...');
			}
		});
	
	$('#searchForm').submit(function()
	{
		$('#searchSubmit').attr("disabled", "disabled");
	});
	
	
	/** DROP DOWN FOR CATEGORIES **/
	$('#catOpen').click(function()
	{
		$('#catSub').fadeIn('fast');
		$('#catOpen').hide();
		$('#catClose').show();
	});
	
	$('#catClose').click(function()
	{
		$('#catSub').fadeOut('fast');
		$('#catOpen').show();
		$('#catClose').hide();
	});
	
	
	/** DROP DOWN FOR RECOMMENDED **/
	$('#recommendOpen').click(function()
	{
		$('ul.recommendDetail').children('.seeMoreDetail').each(function(){
			$(this).show();				
		});
		$('#recommendOpen').hide();
		$('#recommendClose').show();			
	});
	
	$('#recommendClose').click(function()
	{
		$('ul.recommendDetail').children('.seeMoreDetail').each(function(){
			$(this).hide();				
		});
		$('#recommendOpen').show();
		$('#recommendClose').hide();
	});
	
	
	if($('#blogTabPaginator').length > 0 && $('#blogTab').css('display') != 'none')
	{
		setPaginatorCenter('#blogTabPaginator', '.blogTabPaginationControl', '.blogTabItem');
	}
	
	if($('#videoTabPaginator').length > 0 && $('#videoTab').css('display') != 'none')
	{
		setPaginatorCenter('#videoTabPaginator', '.videoTabPaginationControl', '.videoTabItem');
	}	
	
	$('.tabLink1').click(function()
		{
			$('#videoTab').show();
			$('#endlessVideo').show();
			//setPaginatorCenter('#videoTabPaginator', '.videoTabPaginationControl', '.videoTabItem');
			$('#blogTab').hide();
			$('#endlessBlog').hide();
			$('#t1').addClass('active');			
			$('#t2').removeClass('active');			
		});
	
	$('.tabLink2').click(function()
		{
			$('#blogTab').show();
			$('#endlessBlog').show();
			//setPaginatorCenter('#blogTabPaginator', '.blogTabPaginationControl', '.blogTabItem');
			$('#videoTab').hide();
			$('#endlessVideo').hide();
			$('#t2').addClass('active');			
			$('#t1').removeClass('active');			
		});
	
	
	/** SHARE & EMBED BUTTONS - VIDEO PAGE **/
	$('#shareOptBtn').click(function()
		{	
			if($('#shareOpts').css('display') == 'none' || $('#shareOpts').css('display') == null)
			{
				$('#shareOpts').fadeIn('slow');
				$('#embedOpts').hide();
				$('#shareToolBtnIn').hide();
				$('#shareToolBtnOut').show();
				$('#embedToolBtnIn').show();
				$('#embedToolBtnOut').hide();
				return false;
			}
			if($('#shareOpts').css('display') == 'block')
			{
				$('#shareOpts').fadeOut('slow');
				$('#shareToolBtnIn').show();
				$('#shareToolBtnOut').hide();
				return false;
			}
		});
	
	$('#embedCode').click(function()
		{
			if($('#embedOpts').css('display') == 'none' || $('#shareOpts').css('display') == null)
			{
				$('#embedOpts').fadeIn('slow');
				$('#shareOpts').hide();
				$('#embedToolBtnIn').hide();
				$('#embedToolBtnOut').show();
				$('#shareToolBtnIn').show();
				$('#shareToolBtnOut').hide();
				return false;
			}
			if($('#embedOpts').css('display') == 'block')
			{
				$('#embedOpts').fadeOut('slow');
				$('#embedToolBtnIn').show();
				$('#embedToolBtnOut').hide();
				return false;
			}
		});

	/** (DE-)EXPANDING THE SHARE & EMBED BUTTONS **/
	if($('#videoInfo').length > 0)
	{
		var totalWidth = parseInt($('.video_text').css('width').replace('px', ''));
		
		var margins = parseInt($('#tableEmbed').css('marginRight').replace('px', ''))
					  + parseInt($('#tableEmbed').css('marginLeft').replace('px', ''))
					  + parseInt($('#shareOptBtn').css('marginRight').replace('px', ''))
					  + parseInt($('#shareOptBtn').css('paddingLeft').replace('px', ''))
					  + parseInt($('#shareOptBtn').css('paddingRight').replace('px', ''))
					  + parseInt($('#embedCode').css('paddingLeft').replace('px', ''))
					  + parseInt($('#embedCode').css('paddingRight').replace('px', ''));
		
		
				
		var videoInfo = parseInt($('#videoInfo').css('width').replace('px', ''));
		
		var infoWidth = videoInfo + margins + 4;
		
		//alert('total: ' + totalWidth);
		//alert('videoInfo: ' + videoInfo);
		//alert('margin: ' + margins);
		//alert('VideoInfo + margins: ' + infoWidth);
			
		var toolsWidth = Math.floor(((totalWidth - infoWidth) / 2) - 2);
		
		//alert(toolsWidth);
		
		var buttonsWidth = toolsWidth - parseInt($('dd.tableEmbed').css('padding-left').replace('px', ''))
									  - parseInt($('dd.tableEmbed').css('padding-right').replace('px', ''))
									  - parseInt($('#shareOptBtn').css('margin-right').replace('px', ''))
									  - (parseInt($('a.toolBtn').css('padding-left').replace('px', '')) * 2)
									  - (parseInt($('a.toolBtn').css('border-left-width').replace('px', '')) * 2)
									  - (parseInt($('a.toolBtn').css('border-right-width').replace('px', '')) * 2);
		
		
		//var singleBtnWidth = Math.floor(buttonsWidth / 2);
		//alert(singleBtnWidth);
		$('#shareOptBtn').css('width', toolsWidth + 'px');
		$('#embedCode').css('width', toolsWidth + 'px');
	}
	
	
	/** AUTO CENTER THE PAGINATOR **/
	if($('#shoutsPaginator').length > 0)
	{
		setPaginatorCenter('#shoutsPaginator', '.shoutsPaginationControl', '.shoutsItem');
	}
	
	if($('#paginator').length > 0)
	{
		setPaginatorCenter('#paginator', '.paginationControl', '.Item');
	}

	if($('#blogRecentPaginator').length > 0)
	{
		setPaginatorCenter('#blogRecentPaginator', '.blogRecentPaginationControl', '.blogRecentItem');
	}

	if($('#paginator').length > 0)
	{
		setPaginatorCenter('#paginator', '.paginationControl', '.item');
	}
	
	
	/** TOGGLE THE COMMENT SHOW/HIDE FOR VIDEOS **/
	$('a.toggleBody').click(function(){
		var divId = this.title;
		var linkId = this.id;
		
		if($('div#' + divId).css('display') == 'none')
		{
			$('div#' + divId).show('slow');
			$('a#' + linkId).text('Hide');
		}
		else
		{
			$('div#' + divId).hide('slow');
			$('a#' + linkId).text('Show');
		}
		return false;
	});
	

	/** DROP DOWN FOR FOLLOWING **/
	$('#followersOpen').click(function()
	{
		$('ul#following-list').children('.followingHide').each(function(){
			$(this).show();				
		});
		$('#followersOpen').hide();
		$('#followersClose').show();		
		$('#followersDetailOpen').hide();		
		$('#followersDetailClose').hide();	
	});
	
	$('#followersClose').click(function()
	{
		$('ul#following-list').children('.followingHide').each(function(){
			$(this).hide();				
		});
		$('#followersOpen').show();
		$('#followersClose').hide();
		$('#followersDetailOpen').hide();		
		$('#followersDetailClose').hide();
	});
	
	$('#followersDetailOpen').click(function()
	{
		$('ul#followingDetail-list').children('.followingDetailHide').each(function(){
			$(this).show();				
		});
		$('#followersOpen').hide();
		$('#followersClose').hide();		
		$('#followersDetailOpen').hide();		
		$('#followersDetailClose').show();		
	});
	
	$('#followersDetailClose').click(function()
	{
		$('ul#followingDetail-list').children('.followingDetailHide').each(function(){
			$(this).hide();				
		});
		$('#followersOpen').hide();
		$('#followersClose').hide();
		$('#followersDetailOpen').show();		
		$('#followersDetailClose').hide();
	});
	
	
	/** SWITCH THUMB TO DETAIL AND BACK FOR FOLLOWERS **/
	$('#followerGoToDetail').click(function()
	{
		$('ul#followingDetail-list').show();
		$('ul#following-list').hide();
		
		$('#followerGoToDetail').hide();
		$('#followerGoToThumb').show();
		
		$('#followersOpen').hide();
		$('#followersClose').hide();		
		$('#followersDetailOpen').show();		
		$('#followersDetailClose').hide();
		
		$('ul#followingDetail-list').children('.followingDetailHide').each(function(){
			$(this).hide();				
		});
		
		$('ul#following-list').children('.followingHide').each(function(){
			$(this).hide();
		});
		
	});
	
	$('#followerGoToThumb').click(function()
	{
		$('ul#followingDetail-list').hide();
		$('ul#following-list').show();
		
		$('#followerGoToDetail').show();
		$('#followerGoToThumb').hide();
		
		$('#followersOpen').show();
		$('#followersClose').hide();		
		$('#followersDetailOpen').hide();		
		$('#followersDetailClose').hide();
		
		$('ul#followingDetail-list').children('.followingDetailHide').each(function(){
			$(this).hide();				
		});
		
		$('ul#following-list').children('.followingHide').each(function(){
			$(this).hide();				
		});
		
	});
	
});

function hasClass(el, cls)
{
	return el.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
}

function addClass(el, cls)
{
	if (!this.hasClass(el,cls)) el.className += " " + cls;
}

function removeClass(el, cls)
{
	if (hasClass(el, cls))
	{
    	var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
		el.className = el.className.replace(reg, ' ');
	}
}

function trim(str)
{
	return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}

function ucfirst(str)
{
	return str != "" ? "" + str[0].toUpperCase() + str.substring(1, str.length) : "";
}

function getPlayerEmbedCodeByUrl(url, width, height)
{
	var backLink = $('#backLink').val();
//	url = htmlentities(url, "HTML_ENTITIES"); // This may seem dunb but, it works..
	var embedCode = '<object width="' + width + '" height="' + height + '" allowfullscreen="true" allowscriptaccess="always" class="player" data=\'' + url + '\' standby="loading">'
					    + '<param name="movie" value="' + url + '"></param>'
					    + '<param name="allowfullScreen" value="true"></param>'
					    + '<param name="allowscriptaccess" value="always"></param>'
					    + '<embed id="ply" width="' + width + '" height="' + height + '" src="' + url + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true"></embed>'
					+ '</object>';
	
	return embedCode;
}

function getPlayerPopupCodeByUrl(url, width, height)
{
	popup = '<a href="#" onclick="newwindow=window.open(\'' + url +  '\',\'ZideoPlayer\',\'height=' + height + ',width=' + width + ',left=100,top=100,resizable=yes,scrollbars=no,toolbar=no,status=yes\');">clickHere</a>';
	
	return popup;
}

function getPlayerIframeCodeByUrl(url, width, height)
{
	var backLink = $('#backLinkIframe').val();
	url = htmlentities(url, "HTML_ENTITIES");
	var iframeCode = '<iframe width="' + width + '" height="' + height + '" frameborder="0" marginwidth="0" marginheight="0" src="' + url + '">'+ backLink +'</iframe>';

	return iframeCode;
}

function redirect(location, sec)
{
	setTimeout('location.href = "' + location + '"', (sec * 600));
}

function hoverLogin()
{
	drop = document.getElementById('loginForm');
	if (drop.className == 'hidden')
	{
		drop.className = 'show';
		//$('#loginForm').fadeIn();
	}
	else if (drop.className == 'show')
	{
		drop.className = 'hidden';
		//$('#loginForm').fadeOut();
	}
}

function hoverLanguage(state)
{
	drop = document.getElementById('dropdownLanguage');
	if (state == 'hoverIn')
	{
		drop.className = 'show'
	}
	if (state == 'hoverOut')
	{
		drop.className = 'hidden';
	}
}

function toggleCheckboxesByName(name, checked)
{
	$("input[type=checkbox][name*=" + name + "]").each(function() {
		$(this).attr("checked", checked);
	});
}

/*
var tabMenu = function(e)
{
	var targetElm = document.getElementById(e.title);

	//ParentNode of the target element
	var parentNode = targetElm.parentNode;
	var childNodes = parentNode.childNodes;
	
	for (i = 0; i < childNodes.length; i++)
	{
		isWhiteSpace = childNodes[i].isElementContentWhitespace;
		if (true != isWhiteSpace)
		{
			elm = childNodes[i];
			if (targetElm.id == elm.id)
			{
				$("#" + elm.id).show();
			}
			else
			{
				$("#" + elm.id).hide();
			}
		}
	}
	//ParentNode of the clicked item
	//ParentNode = e.target.parentNode.parentNode;
	parentNode = e.parentNode.parentNode;
	childNodes = parentNode.childNodes;
	for (i = 0; i < childNodes.length; i++)
	{
		isWhiteSpace = childNodes[i].isElementContentWhitespace;
		if (true != isWhiteSpace)
		{
			elm = childNodes[i];
			if(elm.className == null)
			{
				elm.className = '';
			}
//			if (e.target.parentNode.id == elm.id)
			if (e.parentNode.id == elm.id)
			{
				if ('-1' == elm.className.indexOf('active'))
				{
					elm.className = elm.className + ' active';
				}
			}
			else
			{
				elm.className = elm.className.replace(' active', '');
			}
		}
	}
	
}*/

var externalCall = function(e)
{
//	e.preventDefault();
	var href = e.href;
	var rel = e.rel;

	if (null != href)
	{
		window.open(href);
	}
	else if (null != rel)
	{
		window.open(rel);
	}
}

var toggleSubForms = function(e)
{
//	parentTag = e.target.parentNode;
	parentTag = e.parentNode;
	if (null !== parentTag)
	{
		parentClass = parentTag.className;
		if (null != parentClass)
		{
			if ('hide' === parentClass)
			{
//				parentTag.className = 'show';
				$(parentTag).children('dl').slideDown('slow', function() {
					parentTag.className = 'show';
				});

			}
			else
			{
//				parentTag.className = 'hide';
				$(parentTag).children('dl').slideUp('slow', function() {
					parentTag.className = 'hide';
				});
			}
		}
	}
}

// sumbit the form 
function formSubmit (form)
{
	var container = $("#" + form.title + "-container");

	if (null != container.attr("id"))
	{
		var sendForm = new Object();
		sendForm.type = "POST";
		sendForm.data = $("#" + form.id).serialize();
		
		sendForm.url = form.action;
		sendForm.success = function (response) {
			container.html(response);

			initForms();
		    initAjax();
		    initShoutBoxes();
		};
		
		// container.html('<img src="/images/ajax-loader.gif" alt="loading" />');
		$.ajax(sendForm);
	}
	else
	{
		alert('Container for AJAX replacement is missing!');
	}
}

function ajaxFormSubmit(form, targetDiv)
{
	var targetDiv = $("#" + targetDiv);

	if (null != targetDiv.attr("id"))
	{
		var actionUrl = $(form).attr("action");
		
		var sendForm = new Object();
		sendForm.type = "POST";
		sendForm.data = $(form).serialize();

		sendForm.url = actionUrl;
		sendForm.success = function (response) {
			targetDiv.html(response);

			initAjax();
			initAjaxLink();
			initShoutBoxes();
			initAjaxRecallSorting();
			
			if (actionUrl.search("\/shout\/partnershout\/") != -1)
			{
				if (null == $("#message-element ul.errors").html())
				{
					var href = window.location.href;
					hrefParts = window.location.href.split("#");
					window.location.href = hrefParts[0];
				}
			}
		};

//		targetDiv.html('<img src="/images/ajax-loader.gif" alt="loading" />');
		$.ajax(sendForm);
	}
	else
	{
		alert('Container for AJAX replacement is missing!');
	}
}

function ajaxHyperlink(targetId, url)
{
	//alert('gogo');
	if ("" != targetId)
	{
		var container = $("#" + targetId);
//		container.html('<img src="/images/ajax-loader.gif" alt="loading" />');
		container.slideUp();
	}

	var params = new Object();
	params.url = url;
	params.success = function (response) {
		if (null != container)
		{
			container.html(response);
			container.slideDown();
				
			initAjax();
			initAjaxLink();
			initConfirmSub();
			initShoutBoxes();
			initAjaxRecallSorting();
			checkFieldsYoutube();
			initAddChannelForm();
			if($('#searchPartnerPaginator').length > 0 && $('#searchTabContent2').css('display') != 'none')
			{
				setPaginatorCenter('#searchPartnerPaginator', '.searchPartnerPaginationControl', '.Item');
			}
			if($('#searchChannelPaginator').length > 0 && $('#searchTabContent3').css('display') != 'none')
			{
				setPaginatorCenter('#searchChannelPaginator', '.searchChannelPaginationControl', '.Item');
			}
			if($('#searchYoutubePaginator').length > 0 && $('#searchTabContent4').css('display') != 'none')
			{
				setPaginatorCenter('#searchYoutubePaginator', '.searchYoutubePaginationControl', '.Item');
			}
		}
	};

	$.ajax(params);
}

function changeSelectbox (targetId, url)
{
	var container = $("#" + targetId);

	if (null != container.attr("id"))
	{
		var params = new Object();
		
		params.url = url;
		params.success = function (response) {
			container.html(response);
		
		    //initializeAjax();
		};

		// container.html('<img src="/images/ajax-loader.gif" alt="loading" />');
		
		$.ajax(params);
	}
	else
	{
		alert('Container for AJAX replacement is missing!');
	}
}

function ajaxCall(elm)
{
	try
	{
		// used by paginator
		var clickParent = elm.parentNode;
		if ('LI' == clickParent.nodeName)
		{
			//Find the list parent container and get child nodes
			clickParent = clickParent.parentNode;
			
			//Loop over the list items
			for (i = 0; i < clickParent.childNodes.length; i++)
			{
				//Find the a elm
				child = clickParent.childNodes[i];
				//Check only for list items
				if ('LI' === child.nodeName)
				{
					//getElementsByTagName return an array of items but we only need the first one..
					a = child.getElementsByTagName('a')[0];
					if ('undefined' !== typeof(a))
					{
						a.className = a.className.replace('active', '');
						if (a.title == elm.title)
						{
							prefix = '';
							if ('undefined' != a.className)
							{
								prefix = a.className;
							}
							a.className = prefix + ' active';
						}
					}
				}
			}
		}
		var rel = elm.rel;
		target = rel.substr(rel.indexOf(':')+1);
		confirmation = true;
		if ('confirm' == rel)
		{
			confirmation = confirm(translate[elm.id]);
		}
		/*
		
		$("#tmp").html('<img src="/images/ajax-loader.gif" alt="loading" />');
		var top = 0;
		if (null != $("#tmp").attr("offsetTop"))
		{
			top = $("#tmp").attr("offsetTop"));
		}*
		
		scroll(0, top);
		*/
		if (confirmation)
		{
			$.ajax({
				url: elm.href,
				success: function(data)
				{
					$('#' + target).html(data);
					/*
					offsetTop = $('#' + target).offset();

					if (null != offsetTop)
					{
						scroll(0, offsetTop.top);
					}
					*/

					// Re-initialize elements
					// Important!
					initAjax();					
					initShoutBoxes();
					initAjaxLink();
					initThumbSwitch();
					initAjaxRecallSorting();
					initCheckAllCheckboxes();
					initDeleteMessages();
					initUnreadMessages();
					initReadMessages();
					initRelated();
					initAddChannelForm();
					
					if($('#paginator').length > 0)
					{
						setPaginatorCenter('#paginator', '.paginationControl', '.Item');
					}
					
					if($('#searchPartnerPaginator').length > 0 && $('#searchTabContent2').css('display') != 'none')
					{
						setPaginatorCenter('#searchPartnerPaginator', '.searchPartnerPaginationControl', '.Item');
					}
					if($('#searchChannelPaginator').length > 0 && $('#searchTabContent3').css('display') != 'none')
					{
						setPaginatorCenter('#searchChannelPaginator', '.searchChannelPaginationControl', '.Item');
					}
					if($('#searchYoutubePaginator').length > 0 && $('#searchTabContent4').css('display') != 'none')
					{
						setPaginatorCenter('#searchYoutubePaginator', '.searchYoutubePaginationControl', '.Item');
					}
					
					if($('#add_channel').length > 0)
					{
						$("#datetimepicker").datetimepicker();
						jQuery("#postAsUser").select_skin();
					    jQuery("#AdminOfChannels").select_skin();
					    jQuery("#replaceChannelVideo").select_skin();
					}
					
					try
					{
						jQuery("#selectParamVM").select_skin();
					}
					catch (error)
					{
					}
					
					// Add confirm to "Delete video" links
					if (location.pathname.match("^/videomanagement"))
					{
						applyDeleteVideoConfirmation()
					}
				},
				error: function (data)
				{
					//alert(data.responseText);
				}
			});
		}
	}
	catch (error)
	{
	}

	return false;
}


/* default zideo functions */

function decision(message, url)
{
	if (confirm(message))
	{
		location.href = url;
	}
}

function getUrlParam(name)
{
	return unescape((RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]);
}

function pr(el)
{
	var output = "";
	for (i in el)
	{
		try
		{
			output += i + " = " + el[i] + "\n\n";
		}
		catch (err)
		{
			output += "ERROR: " + err + "\n\n"; 
		}
	}

	alert(output);
}

