function inout()
{
	var p = 100;
	var in_value = document.getElementById(inId);
	var out_value = document.getElementById(outId);
	if (source_master)
	{
		out_value.value = Math.floor((in_value.value * rate) * p) / p;
	}
	else
	{
		out_value.value = Math.floor((in_value.value / rate)* p) / p;
	}		
}

function outin()
{
	var p = 100;
	var in_value = document.getElementById(inId);
	var out_value = document.getElementById(outId);
	
	if (source_master)
	{
		in_value.value = Math.ceil(out_value.value / rate * p) / p;
	}
	else
	{
		in_value.value = Math.ceil(out_value.value * rate * p) / p;
	}
}

function getObj(sID)
{
	return document.getElementById(sID);
}

function jumpTo(s){
	document.location.href = s;
}

function ShowPopup(popupName, params, wndName, resizable, scrollbars, func)
{
    ReturnPopup = func;
    var wnd,wndWidh=410,wndHeight=500;
    wndX=Math.round((screen.width - wndWidh)/2); wndX=(wndX<0)?0:wndX;
    wndY=Math.round((screen.height - wndHeight)/2); wndY=(wndY<20)?0:wndY-20;
    wnd=open("", wndName, 'status=no,width='+wndWidh+',height='+wndHeight+',resizable='+resizable+',screenX='+wndX+',screenY='+wndY+',top='+wndY+',left='+wndX+',scrollbars='+scrollbars);
    var sTitle = window.document.title
    with(wnd.document)
    {
        open()
        writeln("<html>");
        writeln("   <head>");
        writeln("   <title>"+sTitle+"</title>");
        writeln("   </head>");
        writeln("   <body bgcolor=#ffffff>");
        writeln("<div style='color:#000000;font-family: Arial,Verdana;font-weight: 900;font-size: 18px;'>Loading ...</div>");
        writeln("");
        writeln("   </body>");
        writeln("</html>");
        close();
    }
    wnd.location.href = "http://chat.edram.am/login.aspx?rnd="+ Math.random()+ "&Referer=" + document.location.href;
    wnd.focus();
}

function ShowPagePrintPreview(prnSrc)
{
	var wndWidth=608
	var wndHeight=500
	var wndX=(screen.width-wndWidth)/2
	var wndY=(screen.height-wndHeight)/2
	var wndPrint=window.open("../blank.htm","","Width="+wndWidth+",Height="+wndHeight+",left="+wndX+",top="+wndY+",status=no,resizable=yes,help=no")
	wndPrint.focus()
	with(wndPrint.document)
	{
		writeln("<HTML><HEAD><TITLE>EDram</TITLE>");
		writeln("</HEAD>")
		writeln("<FRAMESET ROWS='44,*' FRAMESPACING=0 BORDER=0 FRAMEBORDER='No'>")
		writeln("  <FRAME NAME='tollbar' SRC='printtoolbar.htm' SCROLLING='No' FRAMEBORDER='No' MARGINWIDTH=0 MARGINHEIGHT=0>")
		writeln("  <FRAME NAME='prntFrame' SRC='"+prnSrc+"' SCROLLING='Auto' FRAMEBORDER='No' MARGINWIDTH=0 MARGINHEIGHT=0>")
		writeln("</FRAMESET></HTML>")
	}
}

function popup(url)
{
	window.open("popups/"+url);
}
