
	
common.prototype.validate_shop_minisearch = function(){
//declaring the 'current_form'
var cf='shop_minisearch';
//disabling the form
sw.enableform(cf, false);
//global variables
this.allow_to_sent="yes";
this.field_status=new Array();
this.missing_fields_msg="";
//emtying (possible showned) 'form_comments'
this.sent_content_to_object(cf+'_comments','Please wait..');
//
var q=this.val_by_name(cf, 'shop_query');

	//in case the field is emty
	if (q.length==0 || this.string_only_spaces(q)==true) {
	this.field_status['q']="emty";
	//disallowing the form to sent
	this.allow_to_sent="no";
	} 
	//
	if(this.field_status['q']!="valid"){
	//setting class of label to unvalid
	this.change_class(cf+"_label_"+'q', "unvalid")
	//setting class of field to unvalid
	this.change_class(cf+"_"+'q', "required unvalid");
		//in case the field is emty
		if(this.field_status['q']=="emty"){
		//adding a new line to the 'missing_fields_msg'
		this.missing_fields_msg+=''+label.field_is_emty.replace(/#item#/g, '');
		this.missing_fields_msg=this.missing_fields_msg.replace(/'/g, '');	
		}
	}
	
	//in case the form may be sended
	if(this.allow_to_sent=="yes"){
	//refreshing validation message
	this.sent_content_to_object(cf+'_comments',label.loading_in_progress+'..');
	//calling php to send the form
	var extra_vars='';
	extra_vars+='?q='+q.replace(/&/g,'[/and]');
	this.goto_url(cf, sw.ptr+sw.searchresultsurl+extra_vars, 'submit');
	}
	//in case the form contains some unvalid fields
	else{
	//refreshing 'form_comments'
	this.sent_content_to_object('shop_minisearch_comments',this.missing_fields_msg);
	//(re)enabling the form
	this.enableform(cf, true);
	}
}

