
function contact() {

	//eror
	var error='';


	// start
	// jQuery('.buton2').addClass('loading');

	// info
	var nume = jQuery('#nume').val();
	var mail = jQuery('#mail').val();
	var url = jQuery('#url').val();
	var link_name = jQuery('#link_name').val();
	var mesaj = jQuery('#mesaj').val();

	// check
	if(nume.length==0 || nume==' ') error += 'Please write your Name <br />';
	if(url.length==0 || url==' ') error += 'Please write the address of your site (URL) <br />';
	if(mail.length==0 || mail==' ') error += 'Please write your Email <br />';
	else {
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		if(reg.test(mail) == false) error += 'Invalid Email Address <br />';
	}
	if(link_name.length==0 || link_name==' ') error += 'Please write a name for your link <br />';

	if(error.length==0) {

		jQuery('.flerror2').slideUp('slow');

		// post
		jQuery.post('ajax.php?a=contact',
			{

				nume: nume,
				mail: mail,
				url: url,
				link_name: link_name,
				mesaj: mesaj

			},
				function(data)
					{

						// afisare ok
						jQuery('.flerror').fadeIn('fast');

						// stop
						// jQuery('.buton2').removeClass('loading');

					}
		);

	} else {
		 // jQuery('.buton2').removeClass('loading');
		jQuery('.flerror2 p').html(error);
		jQuery('.flerror2').slideDown('slow');
	}

}

function ShowImg(img)
{
	var URL;
	URL="showpic.php?img="+img
	window.open(URL,'','status=1,scrollbars=1,width=830,height=720,resizable=1')
}

function account() {
  	if($('#login').is(':hidden')) $('#login').show("slide", { direction: "up" }, 1000);
	else $('#login').hide("slide", { direction: "up" }, 1000);

}

function showmodels(marca) {
	
	jQuery.post('ajax.php?a=showmodels',
			{

				marca: marca

			},
				function(data)
					{
						jQuery('#smodels').html(data);
						jQuery('#SmodelPic').html('');
						// afisare ok
						jQuery('#smodels').fadeIn('fast');

						// stop
						// jQuery('.buton2').removeClass('loading');

					}
		);
	
}

function showmodelpic(id) {
	
	jQuery.post('ajax.php?a=showmodelpic',
			{

				id: id

			},
				function(data)
					{
						jQuery('#SmodelPic').html(data);
						// afisare ok
						jQuery('#SmodelPic').fadeIn('fast');

						// stop
						// jQuery('.buton2').removeClass('loading');

					}
		);
	
}