

/* webme - last GREAT cartTip function  */
$(document).ready(function(){
    $('#cartTip').bt({
	//ajaxPath: 'demofiles/netflix.html',
	centerPointY: .1,
	positions: ['right', 'left'],
	padding: 0,
	width: 306,
	spikeGirth: 60,
	spikeLength: 50,
	cornerRadius: 10,
	fill: '#fbecb8',
	strokeStyle: '#B9090B',
	shadow: true,
	shadowBlur: 12,
	shadowOffsetX: 0,
	shadowOffsetY: 5,
	hoverIntentOpts: {interval: 400, timeout: 0},
	cssStyles: {
		fontSize: '12px',
		fontFamily: 'arial,helvetica,sans-serif'
		},
	contentSelector: "$('#cartTip-content').html()"
    });
});

$(document).ready(function(){
    $("#complainForm").validate({
	    focusInvalid: false,
	    focusCleanup: true,
	rules: {
		complain_username: {
			required: true,
			minlength: 7,
			maxlength: 40
			},
		complain_userphone: {
			required: true,
			number: true,
			minlength: 7,
			maxlength: 20
			},
		complain_message: {
			required: true,
			maxlength: 400
			},
		fConfirmationCode: {
			required: true
			}
		},
	messages: {
		complain_username: {
			required: "Укажите свое имя, пожалуйста!",
			minlength: "Не менее 7 символов",
			maxlength: "Не более 40 символов"
			},
		complain_userphone: {
			required: "Укажите контактный телефон",
			number: "Допускаются только цифры",
			minlength: "Не менее 7 символов",
			maxlength: "Не более 20 символов"
			},
		complain_message: {
			required: "Вы ведь хотели нам что-то написать?..",
			maxlength: "Не более 400 символов"
			},
		fConfirmationCode: {
			required: "Вы не ввели антиспам-код"
			}
		}
        });
});







function webme_setNewCustomerRegType( type )
{
    if (type == 'entity')
	{
	    document.getElementById('newCustomerType').value='entity';
	}
    else
	{
	    document.getElementById('newCustomerType').value='individual';
	}
    
    
    document.getElementById('newCustomerRegForm').submit();
}


function webme_setQuickOrderingCustomerType( type )
{
    if (type == 'entity')
	{
	    document.getElementById('quickOrderingCustomerType').value='entity';
	}
    else
	{
	    document.getElementById('quickOrderingCustomerType').value='individual';
	}
    
    
    document.getElementById('quickOrderingForm').submit();
}

/* show newCustomerType reg form */
function webme_changeNewCustomerForm()
{
    var obj = document.getElementById('nct_changer');
    var type = obj.value;
    
    var ind_regform_div = document.getElementById('individual_RegisterForm_div');
    var ent_regform_div = document.getElementById('entity_RegisterForm_div');
    
    var nct = document.getElementById('newCustomerType');
    
    if (type == 'entity')
	{
	    //ind_regform_div.style.display = 'none';
	    ent_regform_div.style.display = '';
	    nct.value = 'entity';
	}
    else
	{
	    //ind_regform_div.style.display = '';
	    ent_regform_div.style.display = 'none';
	    nct.value = 'individual';
	}
	
}








