var menuitem=0;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function DocPrint(){

 var bRes = window.confirm("Вы хотите распечатать страницу?");

 if(!bRes) return;

 window.print();
}


function profile(id)
{	
	var time = new Date();
	code=time.getTime();
	
	width=500;
	height=300;
	
	if (isOpera==true)
	{
		window.open("/profile.php?id="+id+"&code="+code, '', 'left='+(parseInt(window.screen.width/2)-275)+'px, top=0px, width='+width+'px, height='+height+'px, location=no, resizable=yes, menubar=yes, scrollbars=no');
	} 
	else
	{
		var param="dialogWidth:"+width+"px;dialogHeight:"+height+"px;center:1;dialogHide:0;edge:raised;help:0;menu:1;resizable:0;scroll:0;status:0"
		var mydate = window.showModalDialog("/profile.php?id="+id+"&code="+code,"",param);
	}
	
	return false;
}

/* NEW */
function key_array(needle, haystack, strict) 
{   
    var found = false, key, strict = !!strict;
 
    for (key in haystack) {
        if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
            found = key;
            break;
        }
    }
 
    return found;
}

contacts=false; 

function del_photoalbum(id)
{
 if (confirm("Вы уверены, что хотите удалить фотоальбом со всем содержимым?")) 
 {	
 	parent.location='/user/photoalbum/?action=del_photoalbum&album='+id;	
 }
}




