<!-- 

function openSlideShow(aid){
   window.open("slideshow.php?aid=" + aid, "slideshow", 'width=720,height=540,location=no,toolbar=no,scrollbars=no');
}
          
function openpop(url){
   window.open (url,"user","width=600,height=550,toolbars=yes,scrollbars=yes");
}         

function openpicgallery(name, w, h, i ){
   page = "openpic.php?pic=" + name ;
   window.open (page, i,"width="+w+",height="+h+",toolbars=no,scrollbars=no");
}



function sure(page_url){
  if (confirm("Är du säker på att du vill radera galleriett?")) {
    window.location=page_url;  
  }
}


function sureAll(mgalid){
  if (confirm("Är du säker på att du vill radera meddelande?")) {
    window.location="deletemsg.php?mid="+mgalid;  
  }
}


function checkForm(theForm){
  if ( ((theForm.email.value).indexOf('@') <0) || ((theForm.email.value).indexOf('.') <0)  ){ 
    alert ("Ange en giltig e-postadress");
    return(false);
  }
  if((theForm.sender.value=="")||(theForm.email.value=="")||(theForm.comment.value=="")){
    alert("Fyll i alla obligatoriska fält");
    return(false);
  } 
}

function openpicmgal(pic, w, h, t){
	//alert("k"+pic);
   page = "openpicgal.php?pic=" + pic;
   //alert(page);
   picname = "name_"+pic ;
   window.open("openpicgal.php?pic=" + pic, t, 'width='+w+',height='+h+',location=no,toolbar=no,scrollbars=yes');
   
}

function openpic(id, w, h, picname){
   window.open("openpic.php?pid="+id, picname, 'width='+w+',height='+h+',location=no,toolbar=no,scrollbars=yes');
}

function checkGalleryForm(theForm){
    if((theForm.mgal_artistemail.value=="")||(theForm.mgal_name.value=="")||(theForm.mgal_password.value=="")||(theForm.mgal_artist.value=="")||(theForm.mgal_artistlastname.value=="")||(theForm.mgal_artistaddr.value=="")||(theForm.mgal_artistpostal.value=="") ){
      alert("Fyll i alla obligatoriska fält");
      return(false);
    } 

    if (!(theForm.accept.checked)) {
     alert ("Du måste godkänna att vi lagrar uppgifter enligt PUL");
     return(false);
    }

    if ( ((theForm.mgal_artistemail.value).indexOf('@') <0) || ((theForm.mgal_artistemail.value).indexOf('.') <0)  ){ 
     alert ("Ange en giltig e-postadress");
     return(false);
    }
    return(true);
}

function checkGalleryTextForm(theForm){
  if(theForm.mgal_artisttext.value==""){
       alert("Fyll i alla obligatoriska fält");
      return(false);
  }
 return(true)
}


function checkGalleryLinkForm(theForm){
	/*
	a = (theForm.mgal_linkname.value=="") ;
	b = (theForm.mgal_link1.value.lenght<=7);
    */
	
  // xor 
  if( ( (theForm.mgal_linkname.value=="")&& (theForm.mgal_link1.value.lenght<=7)) || !( (theForm.mgal_linkname.value=="")|| (theForm.mgal_link1.value.lenght<=7))  ){
       alert("1111Fyll i bägge fält");
      return(false);
  }

 return(true)
}



function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

function init(id, opacStart, opacEnd, millisec){
	 changeOpac(0, id);
	 opacity(id, opacStart, opacEnd, millisec);
	}

// -->
