
rightPos=0
if (screen) {
rightPos=screen.width-460
}



function newWindow(bookgif) {
bookWindow=window.open(bookgif,'bookWin','width=330,height=170,left='+rightPos+',top=0')
bookWindow.focus()
}

function newWindow2(bookgif) {
bookWindow=window.open(bookgif,'bookWin','width=450,height=470,left='+rightPos+',top=0')
bookWindow.focus()
}





function validEmail(email) {
invalidChars="/:,;"

if (email=="") {
return false
}

for (i=0; i<invalidChars.lenght; i++) {
badChar=invalidChars.charAt(i)
if (email.indexOf(badChar,0) > -1) {
return false
}
}
atPos=email.indexOf("@",1)
if (atPos==-1) {
return false
}
if (email.indexOf("@",atPos+1) !=-1) {
return false
}
periodPos=email.indexOf(".",atPos)
if (periodPos== -1) {
return false
}
if (periodPos+3 > email.length) {
return false
}
return true
}


function validForm(thisform) {


if (thisform.foretag.value=="") {
alert("Du har inte angivit något företagsnamn")
thisform.foretag.focus()
return false
}

if (thisform.kontaktperson.value=="") {
alert("Du har inte angivit någon kontaktperson")
thisform.kontaktperson.focus()
return false
}


if (thisform.adress.value=="") {
alert("Du har inte angivit någon adress")
thisform.adress.focus()
return false
}

if (thisform.postnr.value=="") {
alert("Du har inte angivit något postnummer")
thisform.postnr.focus()
return false
}

if (thisform.ort.value=="") {
alert("Du har inte angivit någon ort")
thisform.ort.focus()
return false
}

if (thisform.telefonnr.value=="") {
alert("Du har inte angivit något telefonnummer")
thisform.telefonnr.focus()
return false
}


if (thisform.email.value=="") {
alert("Du har inte angivit någon e-mailadress")
thisform.email.focus()
return false
}

if (!validEmail(thisform.email.value)) {
alert("E-mailadressen är inkorrekt angiven. Försök igen")
thisform.email.focus()
thisform.email.select()
return false
}

if (thisform.antalpers.value=="") {
alert("Du har inte angivit antal personer")
thisform.antalpers.focus()
return false
}

kursOption=-1
for (i=0; i<thisform.kursintresse.length; i++) {
if (thisform.kursintresse[i].checked) {
kursOption=1
}
}
if (kursOption== -1) {
alert("Du måste välja minst en av kurserna som Du är intresserad av")
return false
}

return true


}
