/**
 * jQuery Cookie plugin
 *
 * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
jQuery.cookie=function(key,value,options){if(arguments.length>1&&(value===null||typeof value!=="object")){options=jQuery.extend({},options);if(value===null){options.expires=-1}if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days)}return(document.cookie=[encodeURIComponent(key),'=',options.raw?String(value):encodeURIComponent(String(value)),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''))}options=value||{};var result,decode=options.raw?function(s){return s}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null};

/*!
 * HTML5 Placeholder jQuery Plugin v1.8.2
 * @link http://github.com/mathiasbynens/Placeholder-jQuery-Plugin
 * @author Mathias Bynens <http://mathiasbynens.be/>
 */
(function(f){var e='placeholder' in document.createElement('input'),a='placeholder' in document.createElement('textarea');if(e&&a){f.fn.placeholder=function(){return this};f.fn.placeholder.input=f.fn.placeholder.textarea=true}else{f.fn.placeholder=function(){return this.filter((e?'textarea':':input')+'[placeholder]').bind('focus.placeholder',b).bind('blur.placeholder',d).trigger('blur.placeholder').end()};f.fn.placeholder.input=e;f.fn.placeholder.textarea=a}function c(h){var g={},i=/^jQuery\d+$/;f.each(h.attributes,function(k,j){if(j.specified&&!i.test(j.name)){g[j.name]=j.value}});return g}function b(){var g=f(this);if(g.val()===g.attr('placeholder')&&g.hasClass('placeholder')){if(g.data('placeholder-password')){g.hide().next().attr('id',g.removeAttr('id').data('placeholder-id')).show().focus()}else{g.val('').removeClass('placeholder')}}}function d(h){var l,k=f(this),g=k,j=this.id;if(k.val()===''){if(k.is(':password')){if(!k.data('placeholder-textinput')){try{l=k.clone().attr({type:'text'})}catch(i){l=f('<input>').attr(f.extend(c(this),{type:'text'}))}l.removeAttr('name').data('placeholder-password',true).data('placeholder-id',j).bind('focus.placeholder',b);k.data('placeholder-textinput',l).data('placeholder-id',j).before(l)}k=k.removeAttr('id').hide().prev().attr('id',j).show()}k.addClass('placeholder').val(k.attr('placeholder'))}else{k.removeClass('placeholder')}}f(function(){f('form').bind('submit.placeholder',function(){var g=f('.placeholder',this).each(b);setTimeout(function(){g.each(d)},10)})});f(window).bind('unload.placeholder',function(){f('.placeholder').val('')})}(jQuery));

// Google CSE
function googleInputFocus(){document.getElementById('query-input').style['background']=''}function googleInputBlur(){var queryInput=document.getElementById('query-input');if(!queryInput.value){queryInput.style['background']='white url(http://www.google.com/coop/images/'+'google_custom_search_watermark.gif) no-repeat 5px 50%'}}function googleInit(){google.search.CustomSearchControl.attachAutoCompletion('001969021542754218543:mgc67cairwa',document.getElementById('query-input'),'two-page-form');googleInputBlur()}function googleSubmitQuery(){window.location='/soeg/?q='+encodeURIComponent(document.getElementById('query-input').value);return false}google.load('search','1',{language:'da'});function googleGetQuery(){var url=''+window.location;var queryStart=url.indexOf('?')+1;if(queryStart>0){var parts=url.substr(queryStart).split('&');for(var i=0;i<parts.length;i++){if(parts[i].length>2&&parts[i].substr(0,2)=='q='){return decodeURIComponent(parts[i].split('=')[1].replace(/\+/g,' '))}}}return''}function googleOnLoad(){googleInit();var customSearchControl=new google.search.CustomSearchControl('001969021542754218543:mgc67cairwa');customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);var drawOptions=new google.search.DrawOptions();drawOptions.setAutoComplete(true);customSearchControl.draw('results',drawOptions);customSearchControl.execute(googleGetQuery())}google.setOnLoadCallback(googleOnLoad,true);
