

function ViewImage(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=600,left = 340,top = 212');");
}
	function PrintPage(vID)
	{
		var res = window.open('/NewsprintPage.asp?aID=' + vID ,null,"height=480,width=640,status=yes,toolbar=no,scrollbars=1,menubar=no,resizable=1,location=no");
	}		
	function RecomendPage(){
		window.open("/NewsRecomendPage.asp","NewWindow","scrollbars=NO,width=450,height=370")
	}	



var da  = (document.all) ? 1 : 0;
var pr  = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1); 
var bookmarktitle = document.title;
function addfav(){
   var bookmarkurl = 'http://sunnlenskar.eyjafrettir.is/default.asp?BMID=' + parent.frames[2].document.all.xDocID.value;
	if (document.all) window.external.AddFavorite(bookmarkurl,bookmarktitle);
}
function Home(){
		parent.window.location.href = 'default.asp';
}
function RecomendPage(){
		window.open("/NewsRecomendPage.asp","NewWindow","scrollbars=NO,width=450,height=370")
	}
function BookMarkPage(){
		window.open("/vefsidan/Scripts/BookMarkPage.asp","NewWindow","scrollbars=NO,width=450,height=370")
	}
function SearchSite(){
		parent.window.location.href = '/Default.asp?Action=Search&DocID=1';
}
function SiteMap(){
		parent.window.location.href = '/Default.asp?Action=SiteMap&DocID=1';
}
function printPage(frame, arg) {
  if (frame == window) {
    printThis();
  } else {
    link = arg; // a global variable 
    printFrame(frame);
  }
  return false;
}
function printThis() {
  if (pr) { // NS4, IE5
    window.print();
  } else if (da && !mac) { // IE4 (Windows)
    vbPrintPage();
  } else { // other browsers
    alert("<%=langErrorBrowserSupport%>");
  }
} 
function printFrame(frame) {
  if (pr && da) { // IE5
    frame.focus();
    window.print();
    link.focus();
  } else if (pr) { // NS4
    frame.print();
  } else if (da && !mac) { // IE4 (Windows)
    frame.focus();
    setTimeout("vbPrintPage(); link.focus();", 100);
  } else { // other browsers
    alert("<%=langErrorBrowserSupport%>");
  }
}
if (da && !pr && !mac) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln('  OLECMDID_PRINT = 6');
  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}
function PrintDoc(){
		var res = window.open('PrintRead.asp','Print');
	}



function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=1,width=460,height=380,left = 570,top = 410');");
}

