// JavaScript Document
function click(e)
{
  if (document.all)
   {
    if (event.button==2||event.button==3)
    {
     oncontextmenu='return false';
    }
   }
   if (document.layers)
    {
     if (e.which == 3)
     {
      oncontextmenu='return false';
     }
    }
}
if (document.layers)
 {
 document.captureEvents(Event.MOUSEDOWN);
 }   
document.onmousedown=click;

function handleKeyDown()
{
  if (window.event.keyCode == 116)
  {
    event.keyCode=0;
    event.returnValue=false;
  }
}
document.onkeydown = handleKeyDown;

function ClearTextBox()
{
 form1.eMail.value="";
}

function setColorRGB(r, g, b, id)
{
    d=document;
    hr=r.toString(16);
    hg=g.toString(16);
    hb=b.toString(16);
	hr=(hr.length==1)?"0"+hr:hr;
	hg=(hg.length==1)?"0"+hg:hg;
	hb=(hb.length==1)?"0"+hb:hb;
	if (d.getElementById) d.getElementById(id).style.color="#"+hr+hg+hb;
}

function setColor(hexcolor, id)
{
    d=document;
	if (d.getElementById) d.getElementById(id).style.color="#"+hexcolor;
}

var bFarsi = true;
var convTable = new Array( 
	[13,13],[32,32],[33,33],[34,1563],[35,35],
	[36,36],[37,37],[38,38],[39,1711],[40,41],
	[41,40],[42,215],[43,43],[44,1608],[46,46],
	[47,47],[48,1776],[49,1777],[50,1778],[51,1779],
	[52,1780],[53,1781],[54,1782],[55,1783],[56,1784],
	[57,1785],[58,58],[59,1705],[60,1572],[61,61],
	[62,1548],[63,1567],[64,64],[65,1616],[66,1571],
	[67,155],[68,1609],[69,1615],[70,145],[71,71],
	[72,1570],[73,1577],[76,44],[77,1569],[78,1573],
	[79,247],[80,8205],[81,1614],[82,1612],[83,1613],
	[84,8207],[85,1618],[86,139],[87,1611],[88,171],
	[89,8206],[90,187],[91,1580],[92,1688],[93,1670],
	[94,94],[95,1600],[96,1662],[97,1588],[98,1584],
	[99,1586],[100,1740],[101,1579],[102,1576],[103,1604],
	[104,1575],[105,1607],[106,1578],[107,1606],[108,1605],
	[109,1574],[110,1583],[111,1582],[112,1581],[113,1590],
	[114,1602],[115,1587],[116,1601],[117,1593],[118,1585],
	[119,1589],[120,1591],[121,1594],[122,1592],[123,123],
	[124,124],[125,125],[126,1617],[130,76],[147,75],
	[148,74]);

function GetUnicode(iAscii)
{
	var j, index, unicode;
	index = -1;

	for(j=0;j<convTable.length;j++){
		if (convTable[j][0] == iAscii){
			index = j;
			break;
		}
	}
	
	if (index >= 0) 
		 unicode = convTable[index][1];
	else
		unicode = iAscii;
		
	return unicode;
}

function OnTextBoxFarsiKeyPress()
{
	var keyCode, unicode;
	
	keyCode = window.event.keyCode;
	
	if ((window.event.ctrlKey) && (window.event.shiftKey) && (keyCode == 6))
	{
		bFarsi = !bFarsi;
		return;
	}
	
	if ((keyCode == 13) || (bFarsi))
	{
		window.event.keycode = 0;
		if (keyCode == 13)
			return;
		if (bFarsi)
		{
			unicode = GetUnicode(keyCode);
			window.event.keyCode = unicode;
			if ((window.event.shiftKey) && (keyCode == 32))				
				window.event.keyCode = 8204;
		}
	}
}

function OnTextAreaFarsiKeyPress()
{
	var keyCode, unicode;
	
	keyCode = window.event.keyCode;
	if ((window.event.ctrlKey) && (window.event.shiftKey) && (keyCode == 6))
	{
		bFarsi = !bFarsi;
		return;
	}
	
	if (bFarsi)
	{ 
		window.event.keyCode = 0;
		unicode = GetUnicode(keyCode);
		window.event.keyCode = unicode;
		if ((window.event.shiftKey) && (keyCode == 32))			
			window.event.keyCode = 8204;
	}
}

function OpenTrackback (c)
{
    window.open(c,'trackback','width=380,height=420,scrollbars=yes,status=no,menubar=no');
}

	dayName = new Array ("&#1610;&#1705; &#1588;&#1606;&#1576;&#1607; "," &#1583;&#1608;&#1588;&#1606;&#1576;&#1607;"," &#1587;&#1607; &#1588;&#1606;&#1576;&#1607; "," &#1670;&#1607;&#1575;&#1585;&#1588;&#1606;&#1576;&#1607; "," &#1662;&#1606;&#1580;&#1588;&#1606;&#1576;&#1607; "," &#1580;&#1605;&#1593;&#1607; "," &#1588;&#1606;&#1576;&#1607;" )
	monName = new Array ( "&#1583;&#1610;","&#1576;&#1607;&#1605;&#1606;","&#1575;&#1587;&#1601;&#1606;&#1583;","&#1601;&#1585;&#1608;&#1585;&#1583;&#1610;&#1606;","&#1575;&#1585;&#1583;&#1610;&#1576;&#1607;&#1588;&#1578;","&#1582;&#1585;&#1583;&#1575;&#1583;","&#1578;&#1610;&#1585;","&#1605;&#1585;&#1583;&#1575;&#1583;","&#1588;&#1607;&#1585;&#1610;&#1608;&#1585;","&#1605;&#1607;&#1585;","&#1570;&#1576;&#1575;&#1606;","&#1570;&#1584;&#1585;")
	now = new Date
	rr=dayName[now.getDay()]
	if (now.getMonth() <= 1 ) { ii=now.getFullYear()-622 } else { if ( now.getDate() <= 21 && now.getMonth() == 2) { ii=now.getFullYear()-622 } else { ii=now.getFullYear()-621 }}
	if ( now.getMonth() == 6 || now.getMonth() == 7 || now.getMonth() == 8 || now.getMonth() == 9) { if ( now.getDate() <=22 ) { mm=monName[now.getMonth()] } else {mm=monName[now.getMonth()+1]}}
	if ( now.getMonth() == 4 || now.getMonth() == 5 || now.getMonth() == 10 ) { if ( now.getDate() <=21 ) { mm=monName[now.getMonth()] } else {mm=monName[now.getMonth()+1] }}
	if ( now.getMonth() == 0 || now.getMonth() == 2 || now.getMonth() == 3 ) { if ( now.getDate() <=20 ) { mm=monName[now.getMonth()] } else { mm=monName[now.getMonth()+1] }}
	if ( now.getMonth() == 1) { if ( now.getDate() <=19 ) { mm=monName[now.getMonth()] } else { mm=monName[now.getMonth()+1] }}
	if ( now.getMonth() == 11) { if ( now.getDate() <=21 ) { mm=monName[now.getMonth()] } else { mm=monName[now.getMonth()-11] }}
	if ( now.getMonth() == 2 || now.getMonth() == 3 || now.getMonth() == 0 ){if ( now.getDate() <=20 ) {mr=now.getDate()+10 } else {  mr=now.getDate()+10-30 }}
	if ( now.getMonth() == 4 || now.getMonth() == 5 ){ if ( now.getDate() <=21 ) { mr=now.getDate()+10 } else { mr=now.getDate()+10-31 }}
	if ( now.getMonth() == 6 || now.getMonth() == 7 || now.getMonth() == 8 ){ if ( now.getDate() <=21 ) { mr=now.getDate()+9 } else { mr=now.getDate()+9-31 }}
	if ( now.getMonth() == 10 || now.getMonth() == 11){ if ( now.getDate() <=21 ) { mr=now.getDate()+9 } else { mr=now.getDate()+9-30 }}
	if ( now.getMonth() == 9){ if ( now.getDate() <=22 ) { mr=now.getDate()+8 } else { mr=now.getDate()+8-30} }
	if ( now.getMonth() == 1 ){ if ( now.getDate() <=20 ) { mr=now.getDate()+11 } else { mr=now.getDate()+11-30  }}

