function zoominpage()
	javascript.popup([[javascript:function zoomImage(image, amt) { if(image.initialHeight == null) {image.initialHeight = image.height; image.initialWidth = image.width; image.scalingFactor = 1; } image.scalingFactor *= amt; image.width = image.scalingFactor * image.initialWidth; image.height = image.scalingFactor * image.initialHeight; }function rZoomFont(n, node) {for ( var i = 0; i < node.childNodes.length; i++ ) {if (node.childNodes[i].nodeType == 1) rZoomFont(n, node.childNodes[i]);}startSize = getComputedStyle(node,'').getPropertyValue('font-size');startSize = Number(startSize.substr(0,startSize.length-2));lh = getComputedStyle(node,'').getPropertyValue('line-height');if (lh != 'normal') {lh = Number(lh.substr(0,lh.length-2)) * n + 'px';node.style.lineHeight = lh;}newSize = (startSize * n) + 'px';node.style.fontSize = newSize;}rZoomFont(1.1,document.getElementsByTagName('body')[0]); for (i=0; i<document.images.length; ++i) zoomImage(document.images[i], 1.1);]])
end

function zoominimages()
	javascript.popup([[javascript:(function(){ function zoomImage(image, amt) { if(image.initialHeight == null) { /* avoid losing height information due to integer rounding while zooming out */ image.initialHeight = image.height; image.initialWidth = image.width; image.scalingFactor = 1; } image.scalingFactor *= amt; image.width = image.scalingFactor * image.initialWidth; image.height = image.scalingFactor * image.initialHeight; } for (i=0; i<document.images.length; ++i) zoomImage(document.images[i], 1.1); })();]])
end

function zoomoutpage()
	javascript.popup([[javascript:function zoomImage(image, amt) { if(image.initialHeight == null) {image.initialHeight = image.height; image.initialWidth = image.width; image.scalingFactor = 1; } image.scalingFactor *= amt; image.width = image.scalingFactor * image.initialWidth; image.height = image.scalingFactor * image.initialHeight; }function rZoomFont(n, node) {for ( var i = 0; i < node.childNodes.length; i++ ) {if (node.childNodes[i].nodeType == 1) rZoomFont(n, node.childNodes[i]);}startSize = getComputedStyle(node,'').getPropertyValue('font-size');startSize = Number(startSize.substr(0,startSize.length-2));lh = getComputedStyle(node,'').getPropertyValue('line-height');if (lh != 'normal') {lh = Number(lh.substr(0,lh.length-2)) * n + 'px';node.style.lineHeight = lh;}newSize = (startSize * n) + 'px';node.style.fontSize = newSize;}rZoomFont(0.9092,document.getElementsByTagName('body')[0]); for (i=0; i<document.images.length; ++i) zoomImage(document.images[i], .9092);]])
end

function zoomoutimages()
	javascript.popup([[javascript:(function(){ function zoomImage(image, amt) { if(image.initialHeight == null) { /* avoid losing height information due to integer rounding while zooming out */ image.initialHeight = image.height; image.initialWidth = image.width; image.scalingFactor = 1; } image.scalingFactor *= amt; image.width = image.scalingFactor * image.initialWidth; image.height = image.scalingFactor * image.initialHeight; } for (i=0; i<document.images.length; ++i) zoomImage(document.images[i], .9092); })();]])
end

function ZoomImgLinks()
	javascript.popup([[javascript:{var hrefs=document.getElementsByTagName('A'),images='';for(idx=0;idx<hrefs.length;idx++){href=hrefs[idx].href.toUpperCase(); if(href.indexOf('.GIF')>-1||href.indexOf('.BMP')>-1||href.indexOf('.JPEG')>-1||href.indexOf('.JPG')>-1||href.indexOf('.PNG')>-1)images+='<img src='+hrefs[idx]+'><br><br>';}images='<html><body><center><h2>Images</h2><br><br>'+images+'</center></body></html>';document.write(images);document.close();}]])
end

function ViewAllImages()
	javascript.popup([[javascript:Ai7Mg6P='';for (i7M1bQz=0;i7M1bQz<document.images.length;i7M1bQz++){Ai7Mg6P+='<img src='+document.images[i7M1bQz].src+'><br>'};if(Ai7Mg6P!=''){document.write('<center>'+Ai7Mg6P+'</center>');void(document.close())}else{alert('No images!')}]])
end

function saveallimages()
	ViewAllImages()
	id("ID_FILE_SAVE_AS")
end

function zoompage()
	setpref(TYPE_STRING,"kmeleon.general.zoomButtons","both images and text.")
	setcheck("luamacro(zoompage)", true)
	setcheck("luamacro(zoomimages)", false)
	setcheck("luamacro(zoomtext)", false)
end

function  zoomimages()
	setpref(TYPE_STRING,"kmeleon.general.zoomButtons","images only.")
	setcheck("luamacro(zoompage)", false)
	setcheck("luamacro(zoomimages)", true)
	setcheck("luamacro(zoomtext)", false)
end

function zoomtext()
	setpref(TYPE_STRING,"kmeleon.general.zoomButtons","text only.")
	setcheck("luamacro(zoompage)", false)
	setcheck("luamacro(zoomimages)", false)
	setcheck("luamacro(zoomtext)", true)
end