<!--
function tmpHref(str,str2,str3){
document.location = '?page=' + str + '&ID=' + str2 +'&' + str3 ;
}
function tmpWriteGbAnswer(str1)
{
window.open('Private_AnswerGb.asp?id='+ str1 ,'NewWin','location=no,menubar=no,directories=no,scrollbars=no,resizable=no,status=no,width=180,height=160');
}
function tmpOpen(str1,str2)
{
window.open('public_pic_view.asp?bid='+ str1 +'&n=' + str2,'NewWin','location=no,menubar=no,directories=no,scrollbars=no,resizable=YES,status=no,width=900,height=550');
}
function tmpUsrGalleryOpen(str1,str2)
{
window.open('public_gallery_pic_view.asp?bid='+ str1 +'&n=' + str2,'NewWin','location=no,menubar=no,directories=no,scrollbars=no,resizable=YES,status=no,width=900,height=550');
}
function tmpRedirect(str1,str2)
{
window.open('public_redirect.asp?bid='+ str1 +'&id=' + str2,'NewWin','location=no,menubar=no,directories=no,scrollbars=no,resizable=YES,status=no,width=900,height=550');
}


function login(form) {

if (email(form) && password(form))		
		return true;	
	return false;
}
function email(form) {
	if (form.email.value.indexOf("@")!=-1)
		return true;
	alert("Du måste ange en korrekt E-postadress!");   
	form.email.focus();
	return false;	
}
function password(form) {
	if (form.pwd.value.length>3)
		return true;
	alert("Ditt lösenord är för kort, minst 4 tecken är alla lösenord!");
	form.password.focus();	
	return false;
}


function del(url)
{
if(confirm("Är du säker på att du vill ta bort detta?"))
{
self.location=(url);
}
}

function isValidEmail(frmRetrivePwd){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  strEmail = document.frmRetrivePwd.strEmail.value;

   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      alert('Du måste ange en korrekt E-postadress');
      frmRetrivePwd.strEmail.focus();
      return false;
    } 
    return true; 
}

function Validator(theForm)
{

  if (theForm.txtfname.value == "")
  {
    alert("Ange ditt förnamn!");
    theForm.txtfname.focus();
    return (false);
}

  if (theForm.txtfname.value.length < 3)
  {
    alert("Ditt namn måste vara minst 3 tecken!");
    theForm.fname.focus();
    return (false);
  }

  if (theForm.txtlname.value == "")
  {
    alert("Ange ditt efternamn!");
    theForm.txtlname.focus();
    return (false);
  }
  
  
    if (theForm.txtadress.value == "")
  {
    alert("Ange din adress");
    theForm.txtadress.focus();
    return (false);
  }
  
      if (theForm.txtpostnummer.value == "")
  {
    alert("Ange ditt postnummer");
    theForm.txtpostnummer.focus();
    return (false);
  }
  
        if (theForm.txtstad.value == "")
  {
    alert("Ange stad");
    theForm.txtstad.focus();
    return (false);
  }
  
 if (theForm.txtemail.value.indexOf("@")==-1)
 {
   alert("Du måste ange en korrekt E-post adress!");
	theForm.txtemail.focus();
	return(false);
}

if ((theForm.pwd.value != theForm.pwd1.value) || theForm.pwd1.value.length< 3 )
  { 
 alert("Lösenorden stämmer inte överens!\nMinumum längd för lösenordet är 4 tecken!");
  theForm.pwd.focus();
     return(false);
}

 if (theForm.accept.checked == false )
 {
   alert('Du måste acceptera reglerna för att fortsätta!');
    theForm.accept.focus();
    return (false);
	}
 
  return (true);
}	

//-->

