﻿var win=null;
function popHelp(mypage,myname,scroll,pos,w,h){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

function checkSkickaFraga() {
missinginfo = "";
	if (document.fraga.name.value == "") {
		missinginfo += "\n     -  Namn är ej ifyllt";
	}
	if ((document.fraga.email.value == "") || (document.fraga.email.value.indexOf('@') == -1) || (document.fraga.email.value.indexOf('.') == -1)) {
		missinginfo += "\n     -  E-postadressen är ej korrekt";
	}
	if (document.fraga.headline.value == "") {
		missinginfo += "\n     -  Rubrik är ej ifylld";
	}
	if (document.fraga.text.value == "") {
		missinginfo += "\n     -  Frågan är ej ifylld";
	}
	if (!document.fraga.blabox.checked) {
		missinginfo += "\n     -  Du måste klicka i att du läst och förstått vilkoren";
	}
	if (missinginfo != "") {
		missinginfo ="__________________________________________\n" +
		"Följande fel uppstod:\n" +
		missinginfo + "\n__________________________________________" +
		"\nFörsök igen!";
		alert(missinginfo);
		return false;
	}
else return true;
}

function skcheckSkickaFraga() {
missinginfo = "";
	if (document.fraga.sk02.value == "") {
		missinginfo += "\n     -  Namn är ej ifyllt";
	}
	if ((document.fraga.sk03.value == "") || (document.fraga.sk03.value.indexOf('@') == -1) || (document.fraga.sk03.value.indexOf('.') == -1)) {
		missinginfo += "\n     -  E-postadressen är ej korrekt";
	}
	if (document.fraga.sk04.value == "") {
		missinginfo += "\n     -  Rubrik är ej ifylld";
	}
	if (document.fraga.sh02.value == "") {
		missinginfo += "\n     -  Frågan är ej ifylld";
	}
	if (!document.fraga.sh03.checked) {
		missinginfo += "\n     -  Du måste klicka i att du läst och förstått vilkoren";
	}
	if (missinginfo != "") {
		missinginfo ="__________________________________________\n" +
		"Följande fel uppstod:\n" +
		missinginfo + "\n__________________________________________" +
		"\nFörsök igen!";
		alert(missinginfo);
		return false;
	}
else return true;
}

var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-22533641-8']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
