function popup(url,name,width,height,wplus,hplus,focus,left,top,menubar,status,toolbar,scrollbar,resizable,scrx,scry,directories,loc) {
	if ( !url ) return false;
	if ( !name ) name = 'popupWin';
	if ( !width ) width = '';
	if ( !height ) height = '';
	if ( !directories ) directories = 'no';
	if ( !loc ) loc = 'no';
	if ( !menubar ) menubar = 'no';
	if ( !status ) status = 'no';
	if ( !toolbar ) toolbar = 'no';
	if ( !scrollbar ) scrollbar = 'no';
	if ( !resizable ) resizable = 'no';
	if ( !scrx ) scrx = '100';
	if ( !scry ) scry = '100';
	if ( !left ) left = '100';
	if ( !top ) top = '100';
	if ( wplus ) width  += wplus;
	if ( hplus ) height += hplus;

    var popupWin = window.open(url,name,'width='+width+'px,height='+height+'px,left='+left+',top='+top+',menubar='+menubar+',status='+status+',toolbar='+toolbar+',scrollbars='+scrollbar+',resizable='+resizable+',screenX='+scrx+',screenY='+scry+'directories='+directories+',location='+loc);

	if ( focus ) popupWin.focus();
}

function copyField(from, to) {
  document.getElementById(to).value = document.getElementById(from).value;
}

function set(input) {

  input.value = '';
}

function leave(input) {

  input.value = (input.value == '') ? input.defaultValue : input.value;
}
function changeImage(img, img_src) {

  img.src = img_src;
}

var old_div = '';
var is_opened  = 'none';

function toggle( div, link ) {

    div_obj = document.getElementById(div);
    is_opened = div_obj.style.display;

	link_obj = document.getElementById(link);

	if (div != 'j00')
	{		
		document.getElementById('j00').style.display = 'none';
		document.getElementById('a00').style.fontWeight = 'normal';
	}

    if (old_div != '' && is_opened == 'none') {
        old_div_obj = document.getElementById(old_div);
        old_div_obj.style.display = 'none';

		old_link_obj = document.getElementById(old_link);
        old_link_obj.style.fontWeight = 'normal';
    }

    if (old_div != div || is_opened == 'none') {

        div_obj.style.display = 'block';
		link_obj.style.fontWeight = 'bold';
    }

    old_div = div;
	old_link = link;
}

function comments( type ) {
	if ( type == 'show') {
		document.getElementById('comments').style.display = 'block';
		document.getElementById('show').style.display = 'none';
		document.getElementById('hide').style.display = 'block';
	} else {
		document.getElementById('comments').style.display = 'none';
		document.getElementById('show').style.display = 'block';
		document.getElementById('hide').style.display = 'none';
	}
}

var old_shop = '';
var is_opened_shop  = 'none';

function toggleShop( shop ) {

    shop_obj = document.getElementById(shop);
    is_opened_shop = shop_obj.style.display;

	if (shop != 'a11')
	{		
		document.getElementById('a11').style.display = 'none';
	}

    if (old_shop != '' && is_opened_shop == 'none') {
        old_shop_obj = document.getElementById(old_shop);
        old_shop_obj.style.display = 'none';
    }

    if (old_shop != shop || is_opened_shop == 'none') {

        shop_obj.style.display = 'block';
    }

    old_shop = shop;
}

