function CoolsearchBindHandlers(id){var
$search_form=$search_form=$('#s'+id),$cloud_how=$('.cloud-how',$search_form),$cloud_where=$('.cloud-where',$search_form),clouds={'how':{'cloud':$cloud_how,'items':$('a',$cloud_how),'link':$('.tcll',$search_form),'hidden':$('INPUT[rel="kwc"]',$search_form)},'where':{'cloud':$cloud_where,'items':$('a',$cloud_where),'link':$('.tclr',$search_form),'hidden':$('INPUT[rel="rws"]',$search_form)}},getNumber=function($obj,id){if(typeof $obj.rels=='undefined'){$obj.rels={};$obj.each(function(n,el){$obj.rels[el.rel]=n;});}
return $obj.rels[id]||0;},i;$(document).click(function(){clouds.how.cloud.add(clouds.where.cloud).hide();});clouds.how.cloud.add(clouds.where.cloud).bgiframe();for(i in clouds){(function(){var cur=clouds[i];cur.items.click(function(){cur.link.text($(this).text());cur.cloud.hide();cur.hidden.val(this.rel);return false;});cur.link.click(function(){cur.cloud.toggle().css({'margin-top':(-17-19*(getNumber(cur.items,cur.hidden.val())))+'px'});return false;});}());}
$('a.dottedlink2',$search_form).click(function(){$search_form.remove();return false;});};jQuery.fn.coolsearch=function(){return this.each(function(n,el){CoolsearchBindHandlers(el.id.substr(1));});};jQuery.fn.coolsearchDynamic=function(counter){var
$wrapper=('#wrapper'),$origin_form=$('#s1');return this.each(function(){var
new_id,$search_form;if(typeof window.cs_counter=='undefined'){window.cs_counter=counter;}
if(window.cs_counter>10){hide("theend");return false;}
new_id=window.cs_counter+2;$search_form=$origin_form.clone().attr('id','s'+new_id).appendTo($wrapper).show();window.cs_counter+=1;CoolsearchBindHandlers(new_id);$search_form.find('INPUT[name="keys[]"]').attr('value','').focus();});};$(document).ready(function(){$("#s0").coolsearch();$(document).click(function(){$("#topsearchform_popup").hide();$(".niggar").hide().removeClass("niggar");});$("SPAN.yellow_sticker").find("A").click(function(){$("#"+this.rel).removeClass("niggar");$(".niggar").hide().removeClass("niggar");this.blur();toggle(this.rel);$("#"+this.rel).addClass("niggar");return false;});});
