var req;
function multiVideosSetting()
{
	this.Update = function( row )
	{
		var loc = encodeURIComponent(window.location.href);
		//alert( page )
		req = new Ajax.Request('multipleVideosSetting.php',
		{
			method:'post',
			parameters:'row='+row+'&LocationHeader='+loc,
			onSuccess: function(Response)
			{
				
				hideSelectBoxes();
				
				$('page_overlay_box').style.width = '500px';
				$('page_overlay_box').style.height = '400px';
				$('page_overlay_box').update(Response.responseText);
				center('page_overlay_box',500,500);
				$('image_overlay').hide();
				$('page_overlay_box').show();
			},
			onLoading:function()
			{
				showBox();
			},
			onFailure:function()
			{
				alert('fail');
				hideBox();
			}
		});
		
		this.hideBox1 = function () {
			hideBox();
		}
	}
	
	this.CheckFields = function()
	{
		return false;
	}
}

function Cancel(req)
{
	req.transport.abort();	
	$('page_overlay_box').style.width = '0%';
	$('page_overlay_box').style.height = '0%';
	$('page_overlay_box').update('');
	$('page_overlay_box').hide();
	showSelectBoxes();
	hideBox();
}

function uploadVideoURL()
{
	this.Update = function()
	{	//alert(document.getElementById('videourl').value);
		var loc = encodeURIComponent(window.location.href);
		req = new Ajax.Request('uploadVideoUrl.php',
		{
			method:'post',
			parameters:'videourl='+document.getElementById('videourl').value,
			onSuccess: function(Response)
			{
				//alert(Response.responseText);
				document.getElementById('btnurl_upload').style.visibility='visible';
				document.getElementById('urlcopier').style.visibility='hidden';
				document.getElementById('videourl').value = '';
				//alert('just before saving');
				//document.getElementById('videourl').value = Response.responseText;
				
				document.getElementById('uploaded_video_id1').value = '1';
				
			},
			onLoading:function()
			{
			},
			onFailure:function()
			{
				alert('fail');
			}
		});
		
		this.hideBox1 = function () {
			hideBox();
		}
	}
}

var multiVideos = new multiVideosSetting();
var uploadVideo = new uploadVideoURL();