function view_personal_card(name){
var viewpersonalcard=window.open('view_personal_card.php?id='+name,'','width=800,height=700,scrollbars=1');
}


function bg(arg){
event.srcElement.style.backgroundColor=arg;
}

function show_ask(id){
var lay=eval('document.getElementById("row_'+id+'").style');
	if(lay.display=='none'){
		lay.display='block';
		document.getElementById("row_link_"+id).innerHTML='скрыть';
	}
	else{if(lay.display=='block'){
		lay.display='none';
		document.getElementById("row_link_"+id).innerHTML='показать ответ';
	}
	}
}

function view_img(id,alt){
var viewimg=window.open('view_img.php?id='+id+'&alt='+escape(alt),'','width=100,height=100');
}

function seminar_subscribe(){
var seminarsubscribe=window.open('seminar_subscribe.php','seminar_subscribe','width=650,height=420');
}

function win_resize(e,intWidth,intHeight){
  var newW=(intWidth==null || intWidth=='' || isNaN(parseInt(intWidth)))? 800 : parseInt(intWidth);
  var newH=(intHeight==null || intHeight=='' || isNaN(parseInt(intHeight)))? 800 : parseInt(intHeight);
  if(is_ie4 || is_ie){newW+=10;newH+=29;}
  if(is_ns4 || is_ns){newW+=6;newH+=27;}
  if(is_opera){newW+=10;newH+=29;}
  if(is_firefox){newW+=0;newH+=22;}
	if(screen.width>newW)newLeft=Math.round((screen.width-newW)/2);
	 else newLeft=10;
	if(screen.height>newH)newTop=Math.round((screen.height-newH)/2);
	 else newTop=10;
  e.resizeTo(newW,newH);
  e.moveTo(newLeft,newTop);
}

function check_del(arg){
if (confirm("Вы действительно хотите удалить эту запись?")){
 location.href=arg+"&ref="+escape(window.location);
}
 else{void(0);}
}

function openCalendar(params,form,field,type) {
if(is_opera || is_ie4 || is_ie){
	X=event.screenX;
	Y=event.screenY;
	if(is_opera){
		X-=200;
		Y-=200;
	}
}
else{
	var X=0;
	var Y=0;
}
switch (type){
case"time":{cal_height=100;cal_width=260;break;}
case"datetime":{cal_height=230;cal_width=400;break;}
case"date":{cal_height=200;cal_width=400;break;}
}

    window.open("calendar.php?left="+X+"&top="+Y+params, "calendar", "width="+cal_width+",height="+cal_height);
    dateField = eval("document." + form + "." + field);
    dateType = type;
}

var userAgent = navigator.userAgent.toLowerCase();
var is_opera  = (userAgent.indexOf('opera') != -1);
var is_firefox  = (userAgent.indexOf('firefox') != -1);
var is_saf    = ((userAgent.indexOf('applewebkit') != -1) || (navigator.vendor == 'Apple Computer, Inc.'));
var is_webtv  = (userAgent.indexOf('webtv') != -1);
var is_ie     = ((userAgent.indexOf('msie') != -1) && (!is_opera) && (!is_saf) && (!is_webtv));
var is_ie4    = ((is_ie) && (userAgent.indexOf('msie 4.') != -1));
var is_moz    = ((navigator.product == 'Gecko') && (!is_saf));
var is_kon    = (userAgent.indexOf('konqueror') != -1);
var is_ns     = ((userAgent.indexOf('compatible') == -1) && (userAgent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_saf));
var is_ns4    = ((is_ns) && (parseInt(navigator.appVersion) == 4));
var is_mac    = (userAgent.indexOf('mac') != -1);

function move_window_to_center_screen(){
if(is_ns4 || is_ns){
leftco=document.body.offsetWidth+16;
topco=document.body.offsetHeight+44;
}
if(is_ie || is_ie4 || is_firefox){
leftco=document.body.clientWidth;
topco=document.body.clientHeight;
}
if(is_opera){
leftco=document.body.clientWidth;
topco=document.body.clientHeight+200;
}
newLeft=Math.round((screen.width-leftco)/2);
newTop=Math.round((screen.height-topco)/2);

window.moveTo(newLeft,newTop);
}