//<!-- JavaScript Document

var im1=new Image();
var im2=new Image();
im1.src='images/astar.gif';
im2.src='images/pstar.gif';

//Submit Form
function submitForm(id1)
{
document.getElementById(id1).submit();
}


//----------------Flash Link----------------
function gotoPage(url){
	location.href=url;
	}
	
	
//change register button mode
function changeButtonMode(id1,id2)
{
if (document.getElementById(id1).checked) document.getElementById(id2).disabled=false;
else document.getElementById(id2).disabled=true;
}


//delete confirmation
function deletfunc(addr,mess)
{
if (confirm (mess))
	{
	location.href=addr;
	return true;
	}
else return false;
}


//-----------------Add To Favorites----------------------
function addBookmark() {
  if (window.external)
    external.AddFavorite(location.href);
  else
    alert("Your browser doesn't support this feature.");
}


//---------------Set as Homepage----------------
function setasHomepage(t,url)
{
if (t.setHomePage){
	t.style.behavior='url(#default#homepage)';
	t.setHomePage(url);
	}
else alert("Your browser doesn't support this feature.");
}


//-------------rate file------------
function rateIt(n)
{
for (var i=1; i<=n; i++){
	document.getElementById("imr"+i).src=im1.src;
	}	
}

//-----------unrate file------------
function unrateIt(n)
{
for (var i=1; i<=n; i++){
	document.getElementById("imr"+i).src=im2.src;
	}	
}


//open new window
function opennewwin(url,w,h)
{
var w=window.open(url, "newPhoto", 'width='+w+', height='+h+', scrollbars=yes, location=no, menubar=no, status=no, toolbar=no, resizable=yes,top=2,left=2');
}


//-------------------------------Qartulze Gadayvana---------------------------
var eng=new Array(97, 98, 103, 100, 101, 118, 122, 84, 105, 107, 108, 109, 110, 111, 112,
	74, 114, 115, 116, 117, 102, 113, 82, 121, 83, 67, 99, 90, 119, 87, 120, 106, 104);

var geo=new Array(4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, 4315,
	 4316, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329,
	 4330, 4331, 4332, 4333, 4334, 4335, 4336);

var len=eng.length

function qartulze(e, tid)
{
if (document.getElementById('q1')==undefined) return;
if (!document.getElementById('q1').checked) return;

if (e.keyCode && document.getElementById(tid).selectionStart!=undefined)
	for (var i=0; i<len; i++)
		{
		if (e.keyCode==eng[i])
			{
			var b1=document.getElementById(tid).selectionStart;
			var b2=document.getElementById(tid).selectionEnd;
			var str=document.getElementById(tid).value		
			document.getElementById(tid).value=str.substring(0,b1)+String.fromCharCode(geo[i])+str.substring(b2);
			document.getElementById(tid).setSelectionRange(b1+1, b1+1);
			document.getElementById(tid).focus();
			return false
			}	
		}

if (e.keyCode)
	for (var i=0; i<len; i++)
		{
		if (e.keyCode==eng[i])
			{
			e.keyCode=geo[i]
			return true
			}
		}
else
if (e.charCode)
	for (var i=0; i<len; i++)
		{
		if (e.charCode==eng[i])
			{
			var b1=document.getElementById(tid).selectionStart;
			var b2=document.getElementById(tid).selectionEnd;
			var str=document.getElementById(tid).value		
			document.getElementById(tid).value=str.substr(0,b1)+String.fromCharCode(geo[i])+str.substr(b2);
			document.getElementById(tid).setSelectionRange(b1+1, b1+1);
			document.getElementById(tid).focus();
			return false
			}
		}

return true
}

//-->