// Global functions for IT-Print Nacka


// Function to create client-side clock & date _______________________________________________________________________________________________
function doClock(){ // By Paul Davis - www.kaosweaver.com
  var t=new Date(),a=doClock.arguments,str="",i,a1,lang="10";
  var month=new Array('Januari','Jan','Februari','Feb','Mars','Mar','April','Apr','Maj','Maj','Juni','Jun','Juli','Jul','Augusti','Aug','September','Sep','Oktober','Okt','November','Nov','December','Dec');
  var tday= new Array('Söndag','Söndagen den','Måndag','Måndagen den','Tisdag','Tisdagen den','Onsdag','Onsdagen den','Torsdag','Torsdagen den','Fredag','Fredagen den','Lördag','Lördagen den');
  for(i=0;i<a.length;i++) {a1=a[i].charAt(1);switch (a[i].charAt(0)) {
  case "M":if  ((Number(a1)==3) && ((t.getMonth()+1)<10)) str+="0";
  str+=(Number(a1)>1)?t.getMonth()+1:month[t.getMonth()*2+Number(a1)];break;
  case "D": if ((Number(a1)==1) && (t.getDate()<10)) str+="0";str+=t.getDate();break;
  case "Y": str+=(a1=='0')?t.getFullYear():t.getFullYear().toString().substring(2);break;
  case "W":str+=tday[t.getDay()*2+Number(a1)];break; default: str+=unescape(a[i]);}}return str;
}

// Function for login via password  _______________________________________________________________________________________________
function submitentry(){
	password = document.password1.password2.value.toLowerCase()
	username = document.password1.username2.value.toLowerCase()
	passcode = 1
	usercode = 1
	for(i = 0; i < password.length; i++) {
		passcode *= password.charCodeAt(i);
	}
	for(x = 0; x < username.length; x++) {
		usercode *= username.charCodeAt(x);
	}
	if(usercode==2564502222610152000&&passcode==7122563712000)
	{
		window.location=password+".asp"}
	else{
		alert("password/username combination wrong")
	}
}

// Function for openPictureWindow_Fever  _______________________________________________________________________________________________
function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	if (imageType == "swf"){
	newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
	newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('</embed></object>');	}else{
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">'); 	}
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

