//Funktion för att visa vald bild i dropdown
function showimage(){
	ind = document.artikel.bild.selectedIndex;
	val = document.artikel.bild.options[ind].value;
	if (val != 0)
	{
	url = "public_pics/" + val
	MyWin = window.open("","","scrollbars=no,resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,width=100,height=100");
	with(MyWin.document)
	{
		open();
		write("<html>\n<head><link href=\"inc/admin.css\" rel=\"stylesheet\" type=\"text/css\"><meta http-equiv=\"imagetoolbar\" content=\"no\"><scr"+"ipt>awidth=(document.layers)?0:8;awidth+=(document.all)?4:0;aheight=(document.layers)?0:29;</scr"+"ipt>\n<title>Visa bild</title>\n</head>\n<body onLoad=\"window.resizeTo(document.images[0].width+awidth,document.images[0].height+aheight+35)\"marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 rightmargin=0 style=\"overflow:hidden;\">\n");
		write("<img src=\""+url+"\">\n");
		write("<center><a href=\"javascript:self.close()\">Stäng</a>");
		write("</body>\n</html>\n");
		close();
	}
	}
	else
	{
	alert('Ingen bild vald.');
	}	

}
function showimage2(bildobj){
	ind = document.artikel.bild2.selectedIndex;
	val = document.artikel.bild2.options[ind].value;
	if (val != 0)
	{
	url = "public_pics/" + val
	MyWin = window.open("","","scrollbars=no,resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,width=100,height=100");
	with(MyWin.document)
	{
		open();
		write("<html>\n<head><link href=\"inc/admin.css\" rel=\"stylesheet\" type=\"text/css\"><meta http-equiv=\"imagetoolbar\" content=\"no\"><scr"+"ipt>awidth=(document.layers)?0:8;awidth+=(document.all)?4:0;aheight=(document.layers)?0:29;</scr"+"ipt>\n<title>Visa bild</title>\n</head>\n<body onLoad=\"window.resizeTo(document.images[0].width+awidth,document.images[0].height+aheight+35)\"marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 rightmargin=0 style=\"overflow:hidden;\">\n");
		write("<img src=\""+url+"\">\n");
		write("<center><a href=\"javascript:self.close()\">Stäng</a>");
		write("</body>\n</html>\n");
		close();
	}
	}
	else
	{
	alert('Ingen bild vald.');
	}	

}


//Funktion för att visa bild (skicka med adress)
function showimagestr(url){
	MyWin = window.open("","","scrollbars=no,resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,width=100,height=100");
	with(MyWin.document){
	open();
	write("<html>\n<head><link href=\"inc/admin.css\" rel=\"stylesheet\" type=\"text/css\"><meta http-equiv=\"imagetoolbar\" content=\"no\"><scr"+"ipt>awidth=(document.layers)?0:8;awidth+=(document.all)?4:0;aheight=(document.layers)?0:8;</scr"+"ipt>\n<title>Visa bild</title>\n</head>\n<body onLoad=\"window.resizeTo(document.images[0].width+awidth,document.images[0].height+aheight+35)\"marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 rightmargin=0 style=\"overflow:hidden;\">\n");
	write("<a href=\"javascript:self.close()\"><img src=\""+url+"\" border=0></a>\n");
//	write("<center><a href=\"javascript:self.close()\">Stäng</a>");
	write("</body>\n</html>\n");
	close();
	}
}
function over(objekt) {
				
	if (!objekt.contains(event.fromElement)){ 
		objekt.bgColor = '#EEEEEE';
	} 
}			
function out(objekt){
					
	if (!objekt.contains(event.toElement)){ 
		objekt.bgColor = '#FFFFFF'; 
	}
}
function reloadmenu(adminpage) {

eval("top.menu.location='amenu.asp'");
eval("top.main.location='"+adminpage+"'");
}
function reloadmenu2(menupage,adminpage) {

eval("top.menu.location='"+menupage+"'");
eval("top.main.location='"+adminpage+"'");
}


<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

// Sätter focus på första elementet
function findFocus(){
    daform = window.document.forms[0];
    if(daform){
        for(a=0; a<daform.length; a++){
            var daObj = daform[a];
            if(daObj.type == "text" || daObj.type == "textarea" || daObj.type == "file" || daObj.type == "password"){
                daObj.focus();
                break;
            }
            else if (daObj.type.toString().charAt(0) == "s") {
                daObj.focus();
                break;
            }
        }
    }
}



function showhidemenu(obj) {
	if(obj.style.display=='none') {
		obj.style.display=''		
	}
	else {
		obj.style.display='none';
	}	
	}
function showmenu(obj) {
	if(obj.style.display=='none') {
		obj.style.display=''		
	}	
	}
function menyover(obj) {
	obj.style.display=''	
	}
function menyout(obj) {
	obj.style.display='none'
	}
function submitenter(myfield,e){
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	if (keycode == 13)
	{
	myfield.form.submit();
	return false;
	}
	else
	return true;
	}

