function ShowPicture(urlImage, iWidth, iHeight)
		{
		var url = "view_image.aspx?img=" + urlImage;
		var width=iWidth-10;
		var height=iHeight-10;
		var LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
		var TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
		if(iHeight<screen.height)
		{
			window.open(url,'ShowPicture','top='+TopPosition+',left='+LeftPosition+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height+'').focus();
		}
		else
		{
			window.open(url,'ShowPicture','top='+TopPosition+',left='+LeftPosition+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+width+',height='+height+'').focus();
		}
		}
function doSearchAll()
{
var keyword= document.getElementById("keyword").value;
var cbCategory= document.getElementById("cbCategory").value;
window.location.href="search.aspx?action=searchresult&keyword=" + keyword + "&cbCategory=" + cbCategory;
}
function openPollWindow(PollID)
{
	var answer = "";
	var frmForm = document.PollForm;
	for (i = 0; i < frmForm.elements.length; i++)
	{	
		e = frmForm.elements[i];
		if (e.name == "Poll" + PollID && e.checked == true)
		{
			answer = answer + "&answer=" +  e.value;
		}
	}
	//alert(answer);
	pollWindow = window.open('poll_result.aspx?pid=' + PollID + answer,'AQContextHelp','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=490,height=270').focus();
}

function addMailingList()
{
var Email= document.getElementById("MailingList").value;
var strAlert = "";
strAlert = strAlert + EsolCheckRequireField(document.getElementById("MailingList"),"Please enter your email!\n");
strAlert = strAlert + EsolCheckEmail(document.getElementById("MailingList"),"Your email is not valid. Please re-enter!\n");
if(strAlert != "")
{
	alert(strAlert);
}
else
{
	window.location.href="add_mailinglist.aspx?action=add&email=" + Email;
}
return false;
}

function viewPollWindow(PollID)
{
	var answer = "";
	pollWindow = window.open('poll_result.aspx?pid=' + PollID + answer,'AQContextHelp','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=490,height=270').focus();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function openEditor(formName, ImageFolder, strUrl)
{
	
	strUrl = strUrl + "?form=" + formName + "&folder=" + ImageFolder;
	var width=680;
	var height=400;
	var LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
	window.open(strUrl,'OnlineEditor','top='+TopPosition+',left='+LeftPosition+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+'').focus();

}

function checkMemberLogin(strReturnUrl)
{
	var objUsername = document.getElementById('txtLoginUserName');
	var objPassword = document.getElementById('txtLoginPassword');
	var strAlert = "";
	strAlert = strAlert + EsolCheckRequireField(objUsername, "Please enter your username!\n");
	strAlert = strAlert + EsolCheckRequireField(objPassword, "Please enter your password!\n");
	if(strAlert != "")
	{
		alert(strAlert);
		return false;
	}
	else
	{
		document.frmForm.action = "login.aspx?returnUrl=" + strReturnUrl;
		return true;
	}
}
function doSearch()
{
	var objKeyword = document.getElementById('txtKeywordSearch');
	
	window.location.href="search.aspx?keyword=" + objKeyword.value;
}
