function setCookie(name, value, expires){
            document.cookie = name + '=' + escape(value) + '; expires=' + expires.toGMTString() + '; path=/';
        }

        function setApp(t) {
            var f = document.getElementById('loginform');
            r = new RegExp(/app\.(.*)\//i);
            f.action = f.action.replace(r, 'app.' + t.value + '/');
            now = new Date();
            now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
            setCookie('app',t.value,now);
        }


		 $(document).ready(function(){		
			
			if($("#q")) {
				$("#q").focus();
			}
			
		  });

function menu() {
document.write('<div class="menu">');
if (location.href.indexOf("http://hilton.blogsoft.org/portal/custom/seilmagasinet.blogg.no/index.php") != -1){document.write('<a href="#" class="selected">Forsiden</a>');}
else {document.write('<a href="http://hilton.blogsoft.org/portal/custom/seilmagasinet.blogg.no/index.php">Forsiden</a>');}
if (location.href.indexOf("http://hilton.blogsoft.org/portal/custom/seilmagasinet.blogg.no/signup/") != -1){document.write('<a href="#" class="selected">Lag blogg</a>');}
else {document.write('<a href="http://hilton.blogsoft.org/portal/custom/seilmagasinet.blogg.no/signup/">Lag blogg</a>');}
if (location.href.indexOf("http://hilton.blogsoft.org/portal/custom/seilmagasinet.blogg.no/om/") != -1){document.write('<a href="#" class="selected">Om oss</a>');}
else {document.write('<a href="http://hilton.blogsoft.org/portal/custom/seilmagasinet.blogg.no/om/">Om oss</a>');}
if (location.href.indexOf("http://hilton.blogsoft.org/portal/custom/seilmagasinet.blogg.no/hjelp/") != -1){document.write('<a href="#" class="selected">Hjelp</a>');}
else {document.write('<a href="http://hilton.blogsoft.org/portal/custom/seilmagasinet.blogg.no/hjelp/">Hjelp</a>');}
document.write('</div>');
}
	
function getblog() {
document.write('<div class="getblog">');
document.write('<a href="http://blogg.seilmagasinet.no/signup">Lag din egen SEILblogg her &gt; &gt;</a>');
document.write('</div>');
}
function tips() {
document.write('<div class="getblog">');
document.write('<a href="http://blogg.seilmagasinet.no/tips/">Tips en venn om SEILblogg</a>');
document.write('</div>');
}