function popUp(URL) {
	window.open(URL,'popup','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=700,height=450');
}

function Convert(URL) {
	window.open(URL,'convert','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=491,height=271');
}

function menurefresh() {
	//alert("test");
	//eval("parent.contents.location=parent.contents.location");
	eval("parent.contents.location='meny.asp?newitem=yes#korg'");
	//frame.contents.refresh()
}

function skalabild() { 

            var nyahojden = 600; // Höjd om den skall skalas
            var maxhojden = 550; // Maxhöjden
			var maxvidden = 450; // Maxhöjden
            var nyavidden = nyahojden*(document.images.bilden.width/document.images.bilden.height);

   if ( document.images.bilden.height > maxhojden && document.images.bilden.width > nyavidden ) 
      { 
        document.images.bilden.height = nyahojden;
                        document.images.bilden.width = nyavidden;
      } 
} 


function resize_window() { 
     
//Superduper resize window av Mats Vieru för alla webläsare ;)

    	var arrTemp=self.location.href.split("?"); 
		var picUrl = (arrTemp.length>0)?arrTemp[1]:""; 
		var NS = (navigator.appName=="Netscape")?true:false; 
	
		iWidth =  (NS)?window.innerWidth:document.body.clientWidth; 
		iHeight = (NS)?window.innerHeight:document.body.clientHeight;
       				
			if(window.opera){
				  // Opera
				  fixw=25
				  fixh=0
				  //alert ("Opera")
				  
			} else if(navigator.appName == 'Konqueror'){
				  // Konqueror
				  fixw=25
				  fixh=0
				  //alert ("Konqueror")
				  
			} else if(navigator.appName == 'Microsoft Internet Explorer'){
			
						
				if ( navigator.userAgent.indexOf('Mac') != -1 ){ 
								
				// IE MAC
				
				fixw=50
				fixh=50	
				} else {
				
				// IE PC
				fixw=50
				fixh=50				
				//alert ("IE - PC")
				  
				}	
				  
			} else if(navigator.userAgent.indexOf('Safari') != -1){
				  // Safari
				  fixw=300
				  fixh=0
				  //alert ("Safari")
				  
			} else if(navigator.userAgent.indexOf('Firebird') != -1){
				  // Firebird
				  fixw=25
				  fixh=55
				  //alert ("Firebird")
				  
			} else if(navigator.appName == 'Netscape'){
				  // Netscape Navigator, Communicator
				  fixw=50
				  fixh=0
				  //alert ("Netscape Communicator")
				  
			} else if(navigator.userAgent.indexOf('Netscape') != -1){
				  // Netscape
				  fixw=25
				  fixh=0
				  //alert ("Netscape")
				  
			} else if(navigator.userAgent.indexOf('Gecko') != -1){
				  // Mozilla
				  fixw=25
				  fixh=15
				  //alert ("Gecko, Firefox")
				  
			} else {
				  // Else
				  fixw=50
				  fixh=50
				  //alert ("Vet ej!")
				  
			}
		
	    if(navigator.appName == 'mamma'){	
			iWidth =  document.images[0].width - iWidth + 300; 
	        iHeight = document.images[0].height - iHeight + 75;
	        window.resizeBy(iWidth, iHeight);
	                
	    } else if(navigator.userAgent.indexOf('mamma') != -1 ){ 
			window.resizeBy(100, 130);
         
		} else {

			if (x.clientHeight > 600) { 				
			 h = 600	  
			} else {
			 h = x.clientHeight	  
			}

			 w = x.clientWidth
		iWidth = document.images[0].width - iWidth + w + fixw - document.images[0].width; 
	        iHeight = document.images[0].height - iHeight + h + fixh - document.images[0].height;

	        window.resizeBy(iWidth, iHeight); 
		}
       
       self.focus();
     }; 

