﻿
function MouseOver(control)
{
	control.className = 'navlinkred';
}
function MouseOut(control)
{
	control.className = 'navlink';
}
function MouseOut1(control)
{
	control.className = 'navlinkblack';
}
function MouseOver2(control)
{
	control.className = 'navlinkredb';
}
function MouseOut2(control)
{
	control.className = 'navlinkblackb';
}
function MenuMousemove(div)
{
  	div.style.background = "#4b85c7";
	div.style.borderColor = "#547299";
}
function MenuMouseout(div)
{
  	div.style.background = "#1C5AA9";
	div.style.borderColor = "#1C5AA9";
}	
function AnswerMessageMousemove(div)
{
  	div.style.background = "#eaf5fb";
	div.style.borderColor = "#cccccc";
}
function AnswerMessageMouseout(div)
{
  	div.style.background = "#cedeed";
	div.style.borderColor = "#cedeed";
}
function NewMessageMousemove(div)
{
  	div.style.background = "#f1f1f1";
	div.style.borderColor = "#cccccc";
}
function NewMessageMouseout(div)
{
  	div.style.background = "#FFFFFF";
	div.style.borderColor = "#FFFFFF";
}		
function ShowHideSection(modifier,section)
{

	if (section.style.visibility == "hidden" )
	{
		section.style.display = "inline";
		section.style.visibility = "visible";
		modifier.src = "../images/scrollup_hover.gif";
	}
	else
	{
		section.style.display = "none";
		section.style.visibility = "hidden";
		modifier.src = "../images/scrolldown_hover.gif";
	}		
}
function CheckBoxListDisable(radioButton,checkboxlist)
{
	var i,j;
	checkboxlist.disabled = true;
}
function CheckBoxListEnable(radioButton,checkboxlist)
{
	var i,j;
	checkboxlist.disabled = false;
	for(i = 0; i < checkboxlist.rows.length; i++)
		for(j = 0; j < checkboxlist.rows[i].cells.length; j++)
		{
			checkboxlist.rows[i].cells[j].all[0].disabled = false;
			checkboxlist.rows[i].cells[j].all[1].disabled = false;
		}
}
function SetCheckBox(control,status)
{
	for(var i = 0; i < control.rows.length - 1; i++)
	{
		control.rows[i].cells[0].children[0].checked = status;
	}
}
function onDeleteClick()
{
	return confirm("آیا مطمئن هستید که می خواهید این سطر(ها) را حذف نمایید؟")
}
function onLoad(gridName)
{
	for(i = 0; i < document.all.length; i++)
	{
		var x = document.all.item(i)
		if(x != null && x.name != null )
		{
			if(x.name.indexOf(gridName) == 0)
			{
				if(x.name.indexOf("Delete") > 0)
					x.onclick = onDeleteClick;
			}
			else if(x.id.indexOf("Delete") > 0)
					x.onclick = onDeleteClick;
		}
	}
}
function ValidateInputFile(source, arguments)
{
	var postfix = arguments.Value.substring(arguments.Value.lastIndexOf(".") + 1,arguments.Value.length);
	if(postfix == "jpg" || postfix == "jpeg" || postfix == "gif" || postfix == "png" || postfix == "JPG" || postfix == "JPEG" || postfix == "GIF" || postfix == "PNG")
		arguments.IsValid = true;
	else
		arguments.IsValid = false;
}
function ValidatePdfFile(source, arguments)
{
	var postfix = arguments.Value.substring(arguments.Value.lastIndexOf(".") + 1,arguments.Value.length);
	if(postfix == "pdf" || postfix == "PDF")
		arguments.IsValid = true;
	else
		arguments.IsValid = false;
}
function ValidateInputFile2(source, arguments)
{
	var postfix = arguments.Value.substring(arguments.Value.lastIndexOf(".") + 1,arguments.Value.length);
	if(postfix == "jpg" || postfix == "jpeg" || postfix == "gif" || postfix == "png" || postfix == "JPG" || postfix == "JPEG" || postfix == "GIF" || postfix == "PNG" || postfix == "swf" || postfix == "SWF")
		arguments.IsValid = true;
	else
		arguments.IsValid = false;
}
