function cmfCommentAdd(form, url) {
	return cmfAjaxSend(url, { form: form });
}

function cmfCatalogSelect(tag) {
	cmfGetId('imageMainHref').focus();
	//alert(5);
	var parent = tag.parentNode;
	var id = parent.id.replace('list', '');

	var imageMain = $('#imageMain').html();
	$('#imageMain').html($('#image'+id).html());
	$('#image'+id).html(imageMain);

	var catalogMain = $('#catalogMain').html();
	$('#catalogMain').html($('#catalog'+id).html());
	$('#catalog'+id).html(catalogMain);

	var listMain = $('#listMain').html();
	$('#listMain').html($('#list'+id).html());
	$('#list'+id).html(listMain);

	return false;
}

function cmfCatalogSelectImage(parent) {
	//var parent = tag.parentNode;
	var id = parent.id.replace('list', '');

	if(document.SelectImage==id) return false;
	document.SelectImage = id;

	var imageMain = $('#imageMain').html();
	$('#imageMain').html($('#image'+id).html());
	$('#image'+id).html(imageMain);

	var listMain = $('#listMain').html();
	$('#listMain').html($('#list'+id).html());
	$('#list'+id).html(listMain);

	return false;
}

function cmfCatalogSelectImageOver() {
	setTimeout("cmfCatalogSelectImageOver2();", 500);
	return false;
}
function cmfCatalogSelectImageOver2() {
	document.SelectImage = '';
	return false;
}







function cmfProductChangeImage(img, count, obj) {
	cmfGetId('productImg').src = img;
	for(var i=0; i<count; i++) {
		cmfGetId('productImgList' + i).disabled='';
	}
	obj.disabled='disabled';
}

function cmfOpenImage(url, id, width, height) {
	window_top =20+ (screen.height - height) / 2;
	window_left =20+ (screen.width - width) / 2;
	window.open(url, id, 'width='+(width+40)+', height='+(height+20)+', top='+window_top+', left='+window_left+', toolbar=0, statusbar=0, location=0, scrollbars=yes, resizable=0');
	w=w.focus();
	return false;
}

function cmfOpenImage2(url,wnd_name,width,height){
	w=window.open(url,wnd_name,'width='+width+',height='+height+',status=no,menubar=no,resizable=yes,scrollbars=yes,left='+String((screen.width-width)/2)+',top='+String((screen.height-height)/2));w.focus();
	w.focus();
	return false
}

function cmfOpenUser(url, id, width, height) {
	window_top =(screen.height - height) / 2 - 100;
	window_left =(screen.width - width) / 2;
	w=window.open(url, id, 'width='+(width)+', height='+(height)+', top='+window_top+', left='+window_left+', toolbar=0, statusbar=0, location=0, scrollbars=no, resizable=0');
	w.focus();
	return false;
}




function cmfMenuVisible(k) {
	cmfVisibleHidden('section'+ k);
}


function cmfMenuHeader(form) {
	return cmfAjaxSendForm(form, cmfBaseUrl + '/mainAjax/menu/header.php');
}

function basketShange1(value) {    if(value==3) {    	$('.adress2').hide();
    	$('.adress1').show();
    } else {    	$('.adress1').hide();
    	$('.adress2').show();    }}
