function nums(str)
{
    if (str!='')
    {
        var reg=/(\D+)/g 
        var arr=str.replace(reg,'') ;
        if (arr!=null)
        {
            return arr;
        }
        else
        {
            return '';
        }
    }
    return str;
}


function reloadIt()
{
    if (window.opener!=null )
    {
        window.opener.location.hash = '';
        window.opener.location.reload();
//      window.opener.location.href=window.opener.location.href;
    }
    return false;
}

function openWinCentered(loc, winname, widthh, heightt, params)
{
    tp = Math.ceil((screen.height-heightt)/2);
    lf = Math.ceil((screen.width-widthh)/2);
    if (params.length > 0)
	params = "," + params;
        // " asdas dasd das dasm, asdas,das,d ,resizable=no,title=asdasd asdasdas,ajsad=asd
    var win=window.open(loc,winname,"width="+widthh+",height="+heightt+",top="+tp+",left="+lf+params);
    win.focus();
    return win;
}


  isDOM=document.getElementById?true:false
  isOpera=isOpera5=window.opera && isDOM
  isOpera6=isOpera && window.print
  isOpera7=isOpera && document.readyState
  isMSIE=isIE=document.all && document.all.item && !isOpera
  isStrict=document.compatMode=='CSS1Compat'
  isNN=isNC=navigator.appName=="Netscape"
  isNN4=isNC4=isNN && !isDOM
  isMozilla=isNN6=isNN && isDOM

    shift = 70;
    plus = 0;
    if (isMSIE)
    {
        plus = 10;
    }
/*

if (isMozilla )
{
    shift =0;
}

*/ 
/*
function cancelCloseMenu(){
	if(self.tm) clearTimeout(tm) // cancel delayed closing
}


function showMenu2(item_id,uid,nickname,photoID)
{

	if(!self.menu || !self.submenu)
	{
		submenu=layer("submenulayer")
	}
    menu=layer(item_id)
	cancelCloseMenu()
	showed = true;

	submenu.moveTo(menu.getAbsoluteLeft()+ 60, menu.getAbsoluteTop() + 70) // move second menu relatively
	submenu.show()


	document.getElementById('linkBP').onclick = 
	function ()
	{
	    openWinCentered('vote.aspx?userid='+uid+'&photo='+photoID,'',700,650 + plus,'location=no,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no');
	    return false;
	};
	document.getElementById('linkBP1').onclick = document.getElementById('linkBP').onclick;
	
	document.getElementById('linkWM').onclick = 
	function ()
	{
	    openWinCentered('writemessage.aspx?to=inbox&userid='+uid,'',400,610,'location=no,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no');
	    return false;
	};
	document.getElementById('linkWM1').onclick = document.getElementById('linkWM').onclick;
	
	document.getElementById('linkIC').onclick = 
	function ()
	{
	    
	    openWinCentered('chat.aspx?userid='+uid,'',400,345,'location=no,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no');
	    return false;
	};
	document.getElementById('linkIC1').onclick = document.getElementById('linkIC').onclick;

	document.getElementById('linkAF').onclick = 
	function ()
	{
	    openWinCentered('addremFav.aspx?userid='+uid,'',220,285,'location=no,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no');
	    return false;
	};
	document.getElementById('linkAF1').onclick = document.getElementById('linkAF').onclick;
	document.getElementById('linkAPV').href='viewAlbum.aspx?userid='+uid;
	document.getElementById('linkAPV1').href=document.getElementById('linkAPV').href;
	document.getElementById('linkFV').href='friendsView.aspx?userid='+uid;
	document.getElementById('linkFV1').href=document.getElementById('linkFV').href;
	document.getElementById('linkVB').href='viewBlog.aspx?userid='+uid;
	document.getElementById('linkVB1').href=document.getElementById('linkVB').href;
    document.getElementById('linkFM').href='correspondence.aspx?userid='+uid;
	document.getElementById('linkFM1').href=document.getElementById('linkFM').href;
    document.getElementById('linkMP').onclick = 
	function ()
	{
	    openWinCentered('makePresent.aspx?userid='+uid,'',755,545,'location=no,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no');
	    return false;
	};
	document.getElementById('linkMP1').onclick = document.getElementById('linkMP').onclick;
	
	div = document.getElementById('nickNameCell');
	div.innerHTML = nickname;
	
}

tm2 = null;
showed = false;
function showMenu(item_id,uid,nickname)
{
    showed = false;
    tm2 = setTimeout("showMenu2('"+item_id+"','"+uid+"','"+nickname+"',0)",900)
    cancelCloseMenu();
}

function showMenuEx(item_id,uid,nickname,photoID)
{
    showed = false;
    tm2 = setTimeout("showMenu2('"+item_id+"','"+uid+"','"+nickname+"','"+photoID+"')",900)
    cancelCloseMenu();
}
function initiateHideMenu()
{
    if (tm2)
    clearTimeout(tm2);
    if (showed )
    {
	    tm=setTimeout("hideMenu()",700) // 1 second delay to close a submenu
	}
}

function hideMenu(){
    showed = false;
    if (submenu)
	submenu.hide()
	menu=null
}
*/
//reklama section

var divId = 'div_banner22';
var tableId = 'table_banner22'
var bWidth = 800;
var bHeight = 35;
var shift = 1;
var leftPos;

function start()
{
    setInterval("roll()", 30);
    vAlignment();
    document.getElementById(divId).style.visibility = 'visible';
}

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}


function vAlignment()
{
    document.getElementById(divId).style.left = 0 + 'px';
    if (document.all) {
        document.getElementById(divId).style.top = (document.documentElement.scrollTop + getClientHeight() - bHeight) + 'px';
	}
    else {
    document.getElementById(divId).style.top = (window.innerHeight - bHeight) + 'px';
    document.getElementById(divId).style.width = document.body.clientWidth + 'px';
	}
}

function roll()
{
    if (document.getElementById(tableId))
    {   
	
        leftPos = parseInt(document.getElementById(tableId).style.left);
        if (Math.abs(leftPos) >= bWidth)
        {
            document.getElementById(tableId).style.left = (-shift) + 'px';
        }
		else {
			document.getElementById(tableId).style.left = leftPos - shift + 'px';
			}
    }
}

function showBanner(bBody)
{
    var position;
    if (window.attachEvent)
    {
        window.attachEvent("onscroll", vAlignment);
        window.attachEvent("onresize", vAlignment);
        position = "absolute";
    }
    else
    {
        window.addEventListener("scroll", vAlignment, 1);
		window.addEventListener("resize", vAlignment, 1);
        position = "fixed";
    }

    document.write('<div id="' + divId + '" onMouseout="shift=1" onMouseover="shift=0" style="visibility:hidden; overflow:hidden; position:' + position + '; left:0px; width:' + document.body.clientWidth + 'px; height:' + bHeight + 'px; z-index:100;">');
    document.write('<table cellspacing=0 cellpadding=0 id="' + tableId + '" style="position:absolute;left:0;top:0;width:' + (bWidth * 4) + 'px"><tr><td>' + bBody + '</td></table></div>');

    setTimeout("start()", 1000);
}
