function printContent(id){
	//prufa
	id="map";
	str=document.getElementById(id).innerHTML;
	str = str.replace('class="olControlScaleBar olControlNoSelect"','class="olControlScaleBar"');
	newwin=window.open('','printwin','left=100,top=100,width=1050,height=1200');
	newwin.document.write('<HTML>\n<HEAD>\n');
	newwin.document.write('<TITLE>Print Page</TITLE>\n<meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible"/>\n');
		newwin.document.write("<link rel='stylesheet' href='css/print_map.css' type='text/css' media='print'/>");
	newwin.document.write("<link rel='stylesheet' href='css/kortasja.css' type='text/css' media='screen'/>");
	newwin.document.write("<link rel='stylesheet' href='css/tooltip.css' type='text/css' />");
	newwin.document.write("<link rel='stylesheet' href='css/scalebar-LM.css' type='text/css' />");
	newwin.document.write('<style type="text/css">\n');
	newwin.document.write('@media print {@page {size: A4 portrait;}} \n');
	newwin.document.write(' .olControlnewLayerSwitcher{visibility: hidden !important;} \n');
	newwin.document.write(' .olControlNoSelect{visibility:hidden !important;} \n');
	newwin.document.write('</style>\n');
	
	newwin.document.write('<script src="lib/OpenLayers.js"></script>\n');
	newwin.document.write('<script src="lib/jquery-1.3.min.js"></script>\n');
	newwin.document.write('<script src="lib/jquery-ui-personalized-1.5.2.min.js"></script>\n');
	newwin.document.write('<script src="globals.js"></script>\n');
	newwin.document.write('<script>var client_id="skipulag"</script>\n<script src="clients/skipulag.js"></script>\n');
	newwin.document.write('<script src="lib/common.js"></script>\n');
	
	newwin.document.write('<script language=javascript>\n');
	newwin.document.write('	 function loadjscssfile(filename, filetype){\n');
	newwin.document.write('		 if (filetype=="js"){ //if filename is a external JavaScript file\n');
	newwin.document.write('		  var fileref=document.createElement("script")\n');
	newwin.document.write('		  fileref.setAttribute("type","text/javascript")\n');
	newwin.document.write('		  fileref.setAttribute("src", filename)}\n');
	newwin.document.write('		 else if (filetype=="css"){ //if filename is an external CSS file\n');
	newwin.document.write('		  var fileref=document.createElement("link")\n');
	newwin.document.write('		  fileref.setAttribute("rel", "stylesheet")\n');
	newwin.document.write('		  fileref.setAttribute("type", "text/css")\n');
	newwin.document.write('		  fileref.setAttribute("href", filename)}\n');
	newwin.document.write('		 if (typeof fileref!="undefined")\n');
	newwin.document.write('		  document.getElementsByTagName("head")[0].appendChild(fileref)\n');
	newwin.document.write('	}\n');
	newwin.document.write('	var clientCSS = getQuerystring("client");\n');
	newwin.document.write('	loadjscssfile("css/" + clientCSS + ".css", "css") ////dynamically load and add this .css file\n');
	newwin.document.write('</script>\n');

	
	newwin.document.write('<script>var $j = jQuery.noConflict();</script>');
	newwin.document.write('<script language="javascript" type="text/javascript">');
	newwin.document.write('function imposeMaxLength(Object, MaxLen)');
	newwin.document.write('{return (Object.value.length <= MaxLen);}');
	newwin.document.write('</script>');
	newwin.document.write('<script>\n');
	newwin.document.write('function chkstate(){\n');
	newwin.document.write('if(document.readyState=="complete"){\n');
	newwin.document.write('window.close()\n');
	newwin.document.write('}\n');
	newwin.document.write('else{\n');
	newwin.document.write('setTimeout("chkstate()",2000)\n');
	newwin.document.write('}\n');
	newwin.document.write('}\n');
	newwin.document.write('function print_win(){\n');
	newwin.document.write('window.print();\n');
	newwin.document.write('chkstate();\n');
	newwin.document.write('}\n');
	newwin.document.write('<\/script>\n');
	newwin.document.write('</HEAD>\n');
	newwin.document.write('<BODY onload="print_win()"><form>\n');
	newwin.document.write('<img src="img/' + getQuerystring("client") + '_logo.jpg"/><br><br> \n');
	newwin.document.write('<div id="ath"><div id=notes style="position: absolute; top:5px; left:606px;"><b><span id=athTxt><font face=Verdana size=-1>Hér getur þú sett inn þinn texta:</font></span></b><br><textarea cols=50 rows=2  onkeypress="return imposeMaxLength(this, 95);"></textarea></div></div>');
	newwin.document.write('<div id="viewWindow" style="width:'+map.div.clientWidth+'px; height:700px; overflow:hidden; position: absolute; top:80px;">');
	newwin.document.write(str);
	newwin.document.write('</div><BR/><div id=copyright style="position: absolute; top:790px;"><i><b><font face=Verdana size=-1>©Loftmyndir ehf. 2009</font></b></i></div>');
	newwin.document.write('<input type=button id=printBtn value=Prenta onclick="print_win();"  style="position: absolute; top:820px;"/></form>');
	newwin.document.write('<script language=javascript>if(null != document.getElementById("ToolTipPOI_close"))');
	newwin.document.write('document.getElementById("ToolTipPOI_close").style.visibility="hidden";</script>');
	newwin.document.write('</BODY>\n');
	newwin.document.write('</HTML>\n');
	newwin.document.close();
}
function printContent2()
{
	var currentUrl = ( (theBaseMap[map.zoom] == "lightsaber")?viewLink.div.childNodes[0]+"&0101000100100=0101010LOL010101":viewLink.div.childNodes[0].toString().replace( "layers=B0","layers=0B" ).replace( "layers=0B0","layers=00B" ) +"&0101000100100=0101010LOL010101" ); 
	//viewLink.div.childNodes[0]+"&0101000100100=0101010LOL010101";
	var printUrl = currentUrl.replace("kortasja.asp", "print_map.asp");
	newwin=window.open(printUrl,'printwin','left=5,top=5,width=1050,height=810');
}
