// Cascais content system © 2007 // Avanti Media AS - www.finnalle.no function search_post( p, q, s, g, c ) { q = q.replace( /^\s+|\s+$/g, "" ); if ( q != "" ) { document.search.elements[1].style.cursor='progress'; var a=""; q = q.replace( /[ \+\.]/g, "_" ); q = q.replace( /[\\\/]/g, "" ); q = escape( utf8_encode( q ) ); document.search.q.disabled = true; if ( s != "" ) { document.search.s.disabled = true; a = "s"+ s; } if ( g != "" ) { document.search.g.disabled = true; a = a +"-g"+ g; } if ( c != "" ) { document.search.c.disabled = true; a = a +"-c"+ c; } if ( a != "" ) { q = "/"+ q +"/"+ a.replace( /^\-/g, "" ) +".html"; } else { q = "/"+ q +".html"; } if ( p != "" && p != "/" ) { window.location.href = "/"+ p.replace( /\//g, "" ) + q; } else { window.location.href = q; } return false; } else { document.search.q.value = q; return false; } } function utf8_encode( string ) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }