// JavaScript Document
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function ins_ab_email(account) {
dog = '@';
document.write('<a href=\"mailto:'+ account + dog + 'absolutbank.ru\">');
document.write(account + dog +'absolutbank.ru</a>');
}
function ins_ab_pic_email(account, pic, w, h) {
dog = '@';
document.write('<a href=\"mailto:'+ account + dog + 'absolutbank.ru\">');
document.write('<img src="'+pic+'" width="'+w+'" height="'+h+'" alt="Написать письмо" border="0" />');
document.write('</a>');
}
function img_new_win(path, width, height) {
	//status=path;
	window.open(path, null, "height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no");
}
function fill_clipboard(objName) {
	oCode = document.getElementById(objName);
	window.clipboardData.setData("Text", oCode.value);
}
var bodyHTML = '';
function preprint(script_name) {
	bodyHTML = document.body.innerHTML;
	//alert (bodyHTML);
	if (bodyHTML.indexOf("<!--[content]-->") > 0 ) {
		var body_arr = bodyHTML.split("<!--[content]-->");
	} else {
		var body_arr = bodyHTML.split("<spliter ID='breadcrumps'>");
	}
	var bodyContent = body_arr[1] + ' ';
	if (bodyContent.indexOf("<!--[/content]-->") > 0 ) {
		var body_arr = bodyContent.split("<!--[/content]-->");
	} else {
		var body_arr = bodyContent.split("<spliter ID='right_column'>");
	}
	var bodyContent = body_arr[0] + ' ';
	// подменяем кнопку
	var re = /preprint/g;
	var bodyContent = bodyContent.replace(re, 'afterprint');
	var re = /версия для печати/g;
	var bodyContent = bodyContent.replace(re, 'вернуться к обычной версии');
	var headerForPrint = '<table cellpadding="0" cellspacing="0" border="0" width="750" id="topmenu"><tr><td width="200" rowspan="2" style="padding: 0px; padding-top: 5px;"><a href="/"><img src="/images/ab_logo_broker.gif" width="200" height="61" alt="Абсолют Брокер" border="0" /></a></td><td width="50"><img src="/images/dot.gif" width="50" height="1" alt="" /></td><td width="80"><a href="http://www.absolutbank.ru" target="_blank">О&nbsp;БАНКЕ</a></td><td align="center"><img src="/images/vline.gif" width="1" height="15" alt="" /></td><td width="80"><a href="/announce.shtml">НОВОСТИ</a></td><td align="center"><img src="/images/vline.gif" width="1" height="15" alt="" /></td><td width="70"><a href="/banktoday/branches/index.shtml">ОФИСЫ</a></td><td align="center"><img src="/images/vline.gif" width="1" height="15" alt="" /></td><td width="90"><a href="/support.shtml">КОНТАКТЫ</a></td><td align="center"><img src="/images/vline.gif" width="1" height="15" alt="" /></td><td width="100"><a href="/sitemap.shtml">КАРТА&nbsp;САЙТА</a></td></tr></table><br /><table width="750" border="0" cellspacing="0" cellpadding="0"><tr><td>';
	var footerFromPrint = '<br /></td></tr></table><table width="750"  border="0" cellspacing="0" cellpadding="0"><tr><td class="bgfooter_left"><img src="/images/dot.gif" width="20" height="1" hspace="0" alt="" /></td><td class="bgban" align="center" height="50"><p class="contacts">Cправочная служба:  Москва <strong>(495) 7777-156</strong>,  Санкт-Петербург <strong>(812) 3333-222</strong></p></td><td class="bgfooter_right"><img src="/images/dot.gif" width="20" height="1" hspace="0" alt="" /></td></tr></table><br />';
	document.body.innerHTML = headerForPrint + bodyContent + footerFromPrint;
	//alert (document.body.innerHTML);
}
function afterrpint(script_name) {
	document.body.innerHTML = bodyHTML;
}


function OpenFile(url) {
shown=''	
if( shown=='' || shown.closed) {
	shown=window.open(url,'OpenFile','scrollbars=no,status=no, high,width=910,height=550');
}
else{ 
	shown.close();
	shown=window.open(url,'OpenFile','scrollbars=no,status=no, high,width=910,height=550');
}
}


function findOffsetTop (o) { 
  var x = o.offsetLeft, y = o.offsetTop; 
  while (o = o.offsetParent) { 
     x += o.offsetLeft; 
     y += o.offsetTop; 
  } 
  return {left:x, top:y}; 
}; 

function show_menu(id, left_top, hh) 
{ 
    document.getElementById('PPmenu'+id).style.left = left_top['left']+'px'; 
    document.getElementById('PPmenu'+id).style.top  = left_top['top'] + hh+'px'; 
    document.getElementById('PPmenu'+id).style.visibility = "visible"; 
} 

function hide_menu(id) { 
  //timeoutId = setTimeout( function sec( id ) { document.getElementById('PPmenu'+id).style.visibility = "hidden" }, 10000);
	timeoutId = setTimeout("document.getElementById('PPmenu'+id).style.visibility = 'hidden'", 10000);
}


function switch_docs (onObjId, offObjId, setLine, setColor) {
	document.getElementById(onObjId).style.display = "";
	document.getElementById(offObjId).style.display = "none";

	if (setLine == 1) {
		document.getElementById(onObjId + '_td').style.borderBottomColor = "#FF6600";
		document.getElementById(offObjId + '_td').style.borderBottomColor = "#CCCCCC";
	}
	if (setColor == 1) {
		document.getElementById(onObjId + '_a').style.color = "#FF6600";
		document.getElementById(offObjId + '_a').style.color = "#999999";
	}
	return false;
}

function set_invisible(obj_id) {
	document.getElementById(obj_id).style.display = "none";
}
function switch_visible(obj_id) {
	if (document.getElementById(obj_id).style.display == "none") {
		document.getElementById(obj_id).style.display = "";
	} else {
		document.getElementById(obj_id).style.display = "none";
	}
}
