function fnSetValuesVideoView()
{
	//var sFeatures="dialogHeight: " + 400 + "px;dialogWidth:"+ 300+ "px";
	var sFeatures = "'','scrollbars=no,width=500,height=500'";
	return sFeatures;
}

function OpenVideoView(videoPath, quality, title, imageVideoPath, icoVideoPath, descript)
{  
    debugger;
	var sFeatures=fnSetValuesVideoView();
	alert("ManageWebfiles");
	var url = "/VideoView.aspx?VideoUrl=" + escape(videoPath);
	url = url + "&Quality=" + escape(quality);
	url = url + "&Title=" + escape(title);
	url = url + "&Image=" + escape(imageVideoPath);
	url = url + "&Ico=" + escape(icoVideoPath);
	url = url + "&Description=" + escape(descript);
	var valor=window.open(url, "", sFeatures);
	//var valor=window.openShowModal(url, "", sFeatures);
	//window.open("VideoUpload.aspx", "", sFeatures);
	return false;
}

function openPopUp(pageName,width,height,scrolloption)
{
	LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
	newWindow = window.open(pageName,"DisplayWindow","height="+height+",width="+width+",scrollbars="+scrolloption+",top="+TopPosition+",left="+LeftPosition+",resizable=1,noresize=yes,toolbar=0,location=0,directories=0,status=0,menubar=0");
}

function openShowModal(pageName,width,height)
{
	LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
	window.open(pageName,"DisplayWindow","height="+height+",width="+width+",scrollbars=0,top="+TopPosition+",left="+LeftPosition+",resizable=1,noresize=yes,toolbar=0,location=0,directories=0,status=0,menubar=0");
	//window.showModalDialog(pageName,"DisplayWindow","height="+height+",width="+width+",scrollbars=0,top="+TopPosition+",left="+LeftPosition+",resizable=1,noresize=yes,toolbar=0,location=0,directories=0,status=0,menubar=0");
	//showModelessDialog(pageName,window,"status:false;dialogWidth:"+width+"px;dialogHeight:"+height+"px");
}

function cancel(homeLink)
{
	alert(homeLink + '/view-blog.html');
	window.location.href = homeLink + '/view-blog.html';
}

function validateFormField(fieldId, message)
{	
	var field = document.getElementById(fieldId); 
	// field Checker
	if (field.value == 0 )
	{
		alert(message);
		field.focus();
		return false;
	}
	
	return true;
}

function formValidator()
{
	var userId = document.getElementById('userId'); 
	var password = document.getElementById('password');
	
	// UserId Checker
	if (userId.value == 0 )
	{
		alert("Please enter your UserId");
		userId.focus();
		return false;
	}
	
	// Password Checker
	if (password.value == 0 )
	{
		alert("Please enter your password");
		password.focus();
		return false;
	}
	
	return true;
}

/************BLOGS *******************/

function SetCommentRank(rank)
{
	element = document.getElementById('commentRank');	
	element.value =  rank;
}
/*************************************/

/***************PAGINATION***********/
function NextPage(pageNumber)
{
	element = document.getElementById('pageNumber');
	element.value = pageNumber;
	document.forms[0].submit();
}
/************************************/

function ValidateComment()
{
	var field = document.getElementById('commenterName');
	if (field.value == 0 )
	{
		alert('Please enter your Name');
		field.focus();
		return false;
	}
	
	var editor = iged_getById('addCommentBlog_EdTexto');
	if(editor)
	{
		var text = editor.getText();
		if(text == '')
		{
			alert('Please enter your Comment');
			return false;
		}
	}
	
	var code = document.getElementById('addCommentBlog_CodeNumberTextBox');
	
	return true;
}

