﻿var previewMobileWebWindow;
var ieStyle;
var isIE = false;
if (navigator.appName.search(/microsoft/i) >= 0) isIE = true;

var bodyPadding = 2;
var iframeWidth = 320;
var iframeHeight = Math.floor(iframeWidth / .666);
var iframeBorderWidth = 0;
var iframePadding = 0;

var winWidth = iframeWidth + (iframeBorderWidth * 2) + (iframePadding * 2) + (bodyPadding * 2);
var winHeight = iframeHeight + (iframeBorderWidth * 2) + (iframePadding * 2) + (bodyPadding * 2);

if (isIE) {
	iframeWidth = Math.floor(iframeWidth / .60);
	iframeHeight = Math.floor(iframeHeight / .60);
	ieStyle = "zoom:60%;"
}

function previewMobileWeb(URL) {
	var windowOptions = "status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=0, scrollbars=0, width=" + winWidth + ", height=" + winHeight;
	try {
		if (previewMobileWebWindow) previewMobileWebWindow.close();
		previewMobileWebWindow = window.open(URL, "PREVIEWMOBILEWEB", windowOptions);
		previewMobileWebWindow.focus();
	} catch (e) {
		alert(e.name + "\n" + e.number + "\n" + e.description);
	}

}
