var message="";

function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e){	if (document.layers||(document.getElementById&&!document.all))	{	if (e.which==2||e.which==3)		{			(message);			return false;		}	}}
//if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} 

var ParentName=null;

function CheckChanged()
{
	if(event.srcElement.checked)
		event.srcElement.parentElement.parentElement.style.backgroundColor="AAEEAA";
	else
		event.srcElement.parentElement.parentElement.style.backgroundColor="EEFFEE";
}
function SelectAllCB( Sel )
{
	for(i = 0; i < document.all.length; i++)
	{
		if( document.all(i).tagName=="INPUT" &&
		    document.all(i).type=="checkbox" )
		{
			document.all(i).checked=Sel;
			if(Sel)
				document.all(i).parentElement.parentElement.style.backgroundColor="AAEEAA";
			else
				document.all(i).parentElement.parentElement.style.backgroundColor="EEFFEE";
		}
	}
}
function InvertAllCB()
{
	for(i = 0; i < document.all.length; i++)
	{
		if( document.all(i).tagName=="INPUT" &&
		    document.all(i).type=="checkbox" )
		{
			document.all(i).checked=!document.all(i).checked;
			if(document.all(i).checked)
				document.all(i).parentElement.parentElement.style.backgroundColor="AAEEAA";
			else
				document.all(i).parentElement.parentElement.style.backgroundColor="EEFFEE";
		}
	}
}
function GoToLink( Link, Condition, Name, Target, NavAll  )
{
//alert(Name);
	var TheForm = document.createElement("FORM");
	TheForm.id="MyPostForm";
	TheForm.name="MyPostForm";
	TheForm.action=Link;
	TheForm.method="POST";

// Mov
	TheForm.style.position="absolute";
// End Mov

	if(event != null)
	{
		if(event.shiftKey)
			TheForm.target=Name;
	}
	if( Target != null )
		TheForm.target=Target;
	document.body.appendChild(TheForm);
	
	var Value;
	if( Name != null )
		Value = Name;
	else
	{
		Value = event.srcElement.id;
		Value = Value.replace( "Grid", "" );
		Value = Value.replace( "Table", "" );
	}
	var TheInputName=TheForm.document.createElement("<input name='Name' type=hidden value='"+Value+"' >");
	TheForm.appendChild(TheInputName);
//	alert(document.all.Name.value)
	if( Condition != null )
	{

		Value=Condition.replace("$","'");
		Value=Value.replace("$","'");
		var TheInputEditor=TheForm.document.createElement("<input type=hidden name='Condition' value=\""+Value+"\" >");
		TheForm.appendChild(TheInputEditor);
	}
	if( NavAll != null )
	{
		Value=NavAll;
		var TheInputEditor=TheForm.document.createElement("<input type=hidden name='NavAll' value='"+Value+"' >");
		TheForm.appendChild(TheInputEditor);
	}

	if( ParentName != null )
	{
		Value=ParentName;
		var TheInputEditor=TheForm.document.createElement("<input type=hidden name='ParentName' value='"+Value+"' >");
		TheForm.appendChild(TheInputEditor);
	}

//	return;

	TheForm.submit();

}

function DelSelection()
{
	//FillStates(document.all.DelStates);
	//document.all.DelSelBtn.click();
}
function FillStates( TextObj )
{
	TextObj.value="";
	var SelStarted=false, SelEnded=false;
	var IndexCounter=0;
	TextObj.value="";
	for(i = 0; i < document.all.length; i++)
	{
		if( document.all(i).tagName=="INPUT" &&
		    document.all(i).type=="checkbox" )
		{
			if(document.all(i).checked)
			TextObj.value += ","+document.all(i).id.substring(1);
		}
	}
	//TextObj.value = SelStart+","+SelLen;
	//alert(TextObj.value);
	//alert(document.all.StartOrder.value);
	//alert(document.all.EndOrder.value);
	//alert(SelStart);
	//alert(SelLen);
}

//--- By Mova
function InU(){
	event.srcElement.style.borderColor='maroon';
	event.srcElement.style.backgroundColor='#FFFAED';
	event.srcElement.select();
}
function InD(){
	event.srcElement.style.borderColor='gray';
	event.srcElement.style.backgroundColor='#F5F5F5';
}
function BuU(){
	event.srcElement.style.borderColor='EF791C';
	event.srcElement.style.borderWidth=2;
}
function BuD(){
	event.srcElement.style.borderColor='gray';
	event.srcElement.style.borderWidth=1;
}
// End by Mova

function Indilate(taStrr){
	var ty
	testcon = "'\"+()×!#$%^&*()+¿|\\;:></~`"
	for (ty=0; ty<testcon.length; ty++){
		if (taStrr.indexOf(testcon.substr(ty,1))>-1) return true;
	}
	return false;
}
