// krypterad epostadress till klarskrift
function eposttext(myarray, uttext){var encryptedemail=''; //variable to contain encrypted email 
	for (var i=0; i<myarray.length; i++)
		encryptedemail+=String.fromCharCode(myarray[i]);
	encryptedemail='<a href="mailto:'+encryptedemail+'">'+uttext+'</a>';
	return encryptedemail;
}
function epost(myarray) {var encryptedemail=''; //variable to contain encrypted email 
	for (var i=0; i<myarray.length; i++)
		encryptedemail+=String.fromCharCode(myarray[i]);
		encryptedemail='<a href="mailto:'+encryptedemail+'">'+encryptedemail+'</a>';
	 return encryptedemail; 
}
var gh=[105,110,102,111,64,103,104,110,101,116,46,115,101];
var skp=[115,107,97,114,103,97,114,100,115,112,97,100,100,108,97,114,110,97,64,104,111,116,109,97,105,108,46,99,111,109];
var lista=[107,107,101,115,107,112,95,100,101,108,116,97,103,97,114,101,45,115,117,98,115,99,114,105,98,101,64,121,97,104,111,111,103,114,111,117,112,115,46,99,111,109];
var velin=[102,97,109,46,118,101,108,105,110,64,116,101,108,105,97,46,99,111,109];
var l_o=[108,97,114,115,45,111,108,111,118,46,115,118,101,110,115,115,111,110,64,115,119,105,112,110,101,116,46,115,101]
// All-in-one Internal Site Search script- By JavaScriptKit.com (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// This notice must stay intact for use

//Enter domain of site to search.
var domainroot="www.eskima.se"
function mysitesearch(curobj){
document.getElementById("hiddenquery").value="site:"+domainroot+" "+curobj.qfront.value
}
$(function() {
//bildvisare					 	
	$("a[rel='example1']").colorbox({opacity:0.8});
// lägg till uppdateringsdatum					 
	var datum = new Date(document.lastModified)
	datum= $.formatDate(datum,"d MMMM yyyy");
	$("li#datum span").html(datum);							 
// gör epostlänk				
	$("p#epost_skp").html(eposttext(skp, 'e-post till SKP'));
	$("span#epost_skp").html(epost(skp));
	$("span#epost_ghnet").html(epost(gh));
	$("span#epost_lista").html(eposttext(lista, 'skicka ett tomt meddelande till vår maillista'));
	$("p#epost_velin").html(epost(velin));
	$("span#epost_l_o").html(eposttext(l_o, 'kassör'));

});		// $ slut
/*
$.formatDate(date,pattern) Formats the passed date according to the supplied pattern. The tokens that are substituted in the pattern are as follows:
yyyy: the 4-digit year, yy: the 2-digit year, MMMM: the full name of the month, MMM: the abbreviated name of the month, MM: the month number as a 0-filled, 2-character field, M: the month number, dd: the day in the month as a 0-filled, 2-character field, d: the day in the month
EEEE: the full name of the day of the week, EEE: the abbreviated name of the day of the week, a: the meridium (AM or PM), HH: the 24-hour clock hour in the day as a 2-character, 0-filled field, 
H: the 24-hour clock hour in the day, hh: the 12-hour clock hour in the day as a 2-character, 0-filled field, h: the 12-hour clock hour in the day, mm: the minutes in the hour as a 2-character, 0-filled field, m: the minutes in the hour, ss: the seconds in the minute as a 2-character, 0-filled field, s: the seconds in the minute, S: the milliseconds in the second as a 3-character, 0-filled field, Parameters, date (Date) The date to be formatted., pattern (String) The pattern to format the date into. Any characters not matching pattern, tokens are copied as-is to the result. ReturnsThe formatted date.
*/
(function($){$.toFixedWidth = function(value,length,fill) {var result = value.toString();if (!fill) fill = '0';var padding = length - result.length;if (padding < 0) {result = result.substr(-padding);}else {for (var n = 0; n < padding; n++)result = fill + result;}return result;};})(jQuery);(function($){$.formatDate = function(date,pattern) {var result = [];while (pattern.length > 0) {$.formatDate.patternParts.lastIndex = 0;var matched = $.formatDate.patternParts.exec(pattern);if (matched) {result.push($.formatDate.patternValue[matched[0]].call(this,date));pattern = pattern.slice(matched[0].length);} else {result.push(pattern.charAt(0));pattern = pattern.slice(1);}}return result.join('');};$.formatDate.patternParts =/^(yy(yy)?|M(M(M(M)?)?)?|d(d)?|EEE(E)?|a|H(H)?|h(h)?|m(m)?|s(s)?|S)/;$.formatDate.monthNames = [
'januari','februari','mars','april','maj','juni','juli','augusti','september','oktober','november','december'];$.formatDate.dayNames = ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'];$.formatDate.patternValue = {yy: function(date) {return $.toFixedWidth(date.getFullYear(),2);},yyyy: function(date) {return date.getFullYear().toString();},MMMM: function(date) {return $.formatDate.monthNames[date.getMonth()];},MMM: function(date) {return $.formatDate.monthNames[date.getMonth()].substr(0,3);},MM: function(date) {return $.toFixedWidth(date.getMonth() + 1,2);},M: function(date) {return date.getMonth()+1;},dd: function(date) {return $.toFixedWidth(date.getDate(),2);},d: function(date) {return date.getDate();},EEEE: function(date) {return $.formatDate.dayNames[date.getDay()];},EEE: function(date) {return $.formatDate.dayNames[date.getDay()].substr(0,3);},HH: function(date) {return $.toFixedWidth(date.getHours(),2);},H: function(date) {return date.getHours();},hh: function(date) {var hours = date.getHours();return $.toFixedWidth(hours > 12 ? hours - 12 : hours,2);},h: function(date) {return date.getHours() % 12;},mm: function(date) {return $.toFixedWidth(date.getMinutes(),2);},m: function(date) {return date.getMinutes();},ss: function(date) {return $.toFixedWidth(date.getSeconds(),2);},s: function(date) {return date.getSeconds();},S: function(date) {return $.toFixedWidth(date.getMilliseconds(),3);},a: function(date) {return date.getHours() < 12 ? 'AM' : 'PM';}};})(jQuery);	
