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()
{
	//debugger;
	
	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.frmBlog.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;
}

function pagPreviuos(str) {
	//alert("str= " + str);
	window.location.href = str;
}

function pagNext(str) {
	//alert("str= " + str);
	window.location.href = str;
}