function photoManage_FoldersCheck(node) {
	var foldcount = Math.round(document.getElementsByName("folders_selectedcount")[0].value);

	if ( node.Checked )
		foldcount = foldcount + 1;
	else
		foldcount = foldcount - 1;

	document.getElementsByName("folders_selectedcount")[0].value = foldcount;
}

function checkNumericValue(inputid) {
	var input = document.getElementById(inputid);
	if (input!=null && input.value!="") {
		for(i=0;i<input.value.length;i++) {
			if (!(input.value.charCodeAt(i)>=48 && input.value.charCodeAt(i)<=57))
				return false;
		}
		return true;
	} else
		return false;
}

function photoManage_Check( name, imgsmall, imgbig, imgbiginput, namereq, imgsmallwrong, imgbigwrong, imgbigreq, folderreq )
{
	var mess = "";
	
	if (!checkInput(name)) {
		mess = namereq;
		
		tabstripMain.GetTabById('tabstripMain_T0').Click();
		document.getElementById(name).focus();
	}

	if (document.getElementById(imgbiginput).style.display=="inline" && !checkInput(imgbiginput)) {
		if (mess!="")
			mess += "\n";
		mess += imgbigreq;
	}

	var foldcount = Math.round(document.getElementsByName("folders_selectedcount")[0].value);
	if (foldcount==0) {
		if (mess!="") {
			mess += "\n";
		}
		else {
			tabstripMain.GetTabById('tabstripMain_T1').Click();
		}
		mess += folderreq;
	}

	if (mess!="") {
		alert(mess);
	}
	
	return mess=="";
}

function photoAdd_Check( name, imgsmall, imgbig, imgbiginput, namereq, imgsmallwrong, imgbigwrong, imgbigreq, folderreq )
{
	var mess = "";
	
	if (!checkInput(name)) {
		mess = namereq;
		
		tabstripMain.GetTabById('tabstripMain_T0').Click();
		document.getElementById(name).focus();
	}

	if (!checkInput(imgbiginput)) {
		if (mess!="")
			mess += "\n";
		mess += imgbigreq;
	}
	
	var foldcount = Math.round(document.getElementsByName("folders_selectedcount")[0].value);
	if (foldcount==0) {
		if (mess!="") {
			mess += "\n";
		}
		else {
			tabstripMain.GetTabById('tabstripMain_T1').Click();
		}
		mess += folderreq;
	}

	if (mess!="") {
		alert(mess);
	}
	
	return mess=="";
}


function showPhotoPreview(url,width,height) {
	height += 35;
	width += 17;
	window.open(url,'photopreview','toolbar=no,resizable=no,width='+width+',height='+height);
}