/**
* Site PartnerBoxSearch
*
* @author Szijártó Tamás ( szicsu )
* @email  szicsu@jquery.hu
**/

if ( typeof Site != 'object'){
    var Site = {};
}


Site.PartnerBoxSearch = new function(){
    var self = this;    
	
	//mind a a ketto jo
	//Site.BaseSearch.apply( this, [self]);
	Site.BaseSearch.call( this, self);
	
    
	this.cookieName = 'partnerboxs';
	
	this.getActiveForm = function(){
		return $('#complex_motorbike');
	}
	
	this.get = function( rUrl, data ,callBack)
	{
		self.actRequest = $.getJSON(
			rUrl + '?jsoncallback=?&'+$.param(data),
			function( json ){ if( typeof callBack == 'function' ){ callBack(json); }});
/*
		self.actRequest = $.ajax({
			url: rUrl,
			type: "POST",
			cache: false,
			data: postData,
			async: true,
			dataType: "json",
			success: function( data ){
				if( typeof callBack == 'function' ){
					callBack( data );
				}
			}
		   
		});
*/
		
		return false;
	}

	
	
	this.getSearchActionUrl = function(){
		if ( typeof hasznaltmotorok == 'object' ) {
			return hasznaltmotorok.uri('/ajaxsearch/partnerboxsearch');
		} else {
			return '/ajaxsearch/partnerboxsearch';
		}
	}
	
	
	
	this.init = function(){
		
		this.initForm( this.getActiveForm() );
		this.initInputs( this.getActiveForm() );
		
		if( self.getCookie() ){
			this.sendSearch( self.getCookie().data );
		}



            
		
	}
	
	
	this.destruct = function(){
		self.setCookie( $.toJSON( self.backupForm() ) );	
	}
	
	
}



