function fulloffset(obj, type) {
	 var wb = 0;
	 var s = obj;
	 while(s) {
		  wb += s[type];
		  s = s.offsetParent;
	 }
	 return wb;
};

/*
function writeMail(user, domain) {
	var mail = user+'@'+domain;
	document.write('<a href="mail'+'to:'+mail+'">'+mail+'</a>');
}
*/

var curentTabag=3;

function switch_tab_ag(tab){

	/* Текущая закладка */
	var tblnk=$('tblnk_'+curTabag);
	if (tblnk) tblnk.className=''; //tblnk.style.fontWeight='normal';
	tbcnt=$('tbcnt_'+curTabag);
	if (tbcnt) {
		var display=tbcnt.style.display;
		tbcnt.style.display='none';
	}

	/* Новая закладка */
	curTabag=tab.id.toString().substr(6,1);
	tblnk=$('tblnk_'+curTabag);
	if (tblnk) tblnk.className='activetab'; //tblnk.style.fontWeight='bold';
	tbcnt=$('tbcnt_'+curTabag);
	if (tbcnt) tbcnt.style.display=display; //'table-row';
}

function openWnd(url, wnd_name, width, height){
    /* wnd=window.open('/inc/content.php?tpl=bigimages&noajax&id='+id+'&type='+type, null, 'height=400,width=340,scrollbars=1,resizable=1,status=1,toolbar=0,menubar=0,location=0'); */
    wnd=window.open(url,wnd_name,'width='+width+',height='+height+',status=no,menubar=no,resizable=no,scrollbars=no,left='+String((screen.width-width)/2)+',top='+String((screen.height-height)/2));
    wnd.focus();
}

function showImg(url, width, height){
    openWnd(url,'photo', width, height);
}
function showImg600(url){
    openWnd(url,'photo', 600, 400);
}

function writeMail(user, domain, innerHTML) {
    var mail = user+'@'+domain;
    var innerHTML = innerHTML || mail;
    document.write('<a href="mail'+'to:'+mail+'">'+innerHTML+'</a>');
}

