protected function generateJqueryCode($selector, $function){
	
		$code = '$( "'.$selector.'" ).'.$function.'(';
		$optionsShown = false;
		
		
		foreach($this->necessary as $pname => $v){		
			$pvalue = $this->getParam($pname);
			if($pvalue == null)
				$pvalue = $this->defValues[$pname];
			if(!empty($pvalue) && $pvalue != ""){

				if(!$optionsShown){
					$code .= '{';
					$optionsShown = true;
				}else
					$code .=',';

				$code .= "\n $pname : \"$pvalue\"";
			}

		}
		
		foreach($this->getParams() as $pname => $pvalue){
		
			if((!isset($this->necessary[$pname]) && isset($this->defValues[$pname]))
					|| (isset($this->defValues[$pname]) && strtoupper($this->defValues[$pname]) != strtoupper($pvalue) )){
				
				if(!empty($pvalue) && $pvalue != ""){
				
					if(!$optionsShown){
						$code .= '{';
						$optionsShown = true;
					}else
						$code .=',';

					unset($necessary[$pname]);

				$code .= "\n $pname : $pvalue";
				}
			}
		}
		
		
		
		if($optionsShown)
			$code .= "\n}";
		
		$code .= ');';
		
		return $code;
	}