/*
 * arsredovisning.js - JavaScript to support arsredovisning 
*/

function openPaper(pid){
 var res_height,res_width,resOK,errorUrl,cookieOK
 resOK = false;
 res_height = screen.height;
 res_width = screen.width;
 if(res_width >= 1024 && res_height >= 768)
  resOK = true;
 
 if(resOK != true){
  window.open('http://www3.e-magin.se/show/ekn/show.asp?pid='+pid,'emagin'+pid,'width=780,height=540,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
 } else {
  if(screen.width==1024) {
   window.open('http://www3.e-magin.se/show/ekn/show.asp?action=maximize&pid='+pid,'emagin'+pid,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
  } else {
   window.open('http://www3.e-magin.se/show/ekn/show.asp?pid='+pid,'emagin'+pid,'width=1020,height=745,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
  }
 }
}

/*
	Från och med årsredovisning 2005 hämtas årsredovisningen på mypaper.se
	Inlagt 27 mars 06, André Ekespong, Xlent
 */

function openMyPaper(pid,type){
	var res_height,res_width,resOK,errorUrl,cookieOK
	resOK = false;
	res_height = screen.height;
	res_width = screen.width;
	if(res_width >= 1024 && res_height >= 768)
		resOK = true;
	
	if(resOK != true){
		if(type==1) {
			window.open('http://www.mypaper.se/show/ekn/show.asp?pid='+pid,'mypaper'+pid,'width=780,height=540,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
		} else {
			window.open('http://www.mypaper.se/show/ekn/show.asp?&action=maximize&pid='+pid,'mypaper'+pid,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
		}
	} else {
		if(screen.width==1024) {
			window.open('http://www.mypaper.se/show/ekn/show.asp?action=maximize&pid='+pid,'mypaper'+pid,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
		} else {
			window.open('http://www.mypaper.se/show/ekn/show.asp?pid='+pid,'mypaper'+pid,'width=1020,height=745,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
		}
	}
}

// För att stödja tidigare lösningar
function openMypaper(pid){
	openMyPaper(pid, 2);
}

function openMypaperDyn(pid){
	openMyPaper(pid, 2);
}
