﻿// JScript File

//function used to preview of image from listing page
var newwindow=null;
function PreviewImage(folderName,imgName)
{
    if (newwindow != null) 
    {
        if(newwindow.closed==false)
            newwindow.close();
    }    
    var img = new Image();
    img.src = folderName+"/"+imgName; 
    //alert(img.src);
    var height=150;
    var width=150;
   //alert(height+"*---------"+width);
    newwindow=window.open("", "","location=0, menubar=0, resizable=1, scrollbars=1, status=0,titlebar=0, toolbar=0, height="+height+", width="+width);
    newwindow.moveTo(50,50);
    var htmlString="<html><head><title>Preview Image</title><link href=\"includes/css/global.css\" rel=\"stylesheet\" type=\"text/css\"/></head><body>";
        htmlString+="<table cellspacing='0' cellpadding='0' border='0' align='center'>";
        htmlString+="<tr><td align='center'>";
        htmlString+="<img src='"+folderName+"/"+imgName+"' alt='' /></td</tr><tr><td>&nbsp;</td></tr><tr>";
        htmlString+="<td align='center'>";
        htmlString+="<input type=\"button\" id=\"btnClose\" value=\"Close\" class=\"button\" onclick=\"javascript:window.close()\" />";
        htmlString+="</td>";
        htmlString+="</tr></table></body></html>";
    newwindow.document.write(htmlString);
    newwindow.document.close();
    if (window.focus)
	{
		newwindow.focus();
	}
}

//function used to preview NEWSLETTER TEMPLATE
var newwindow=null;
function PreviewTemplate(imgName)
{
    if (newwindow != null) 
    {
        if(newwindow.closed==false)
            newwindow.close();
    }    
    var img = new Image(210,210);
    img.src = "images/"+imgName+".jpg";
    
    newwindow=window.open("", "","location=0, menubar=0, resizable=1, scrollbars=1, status=0,titlebar=0, toolbar=0, height="+(img.height+200)+", width="+(img.width+200));
    newwindow.moveTo(50,50);
    var htmlString="<html><head><title>Preview Image</title><link href=\"includes/css/global.css\" rel=\"stylesheet\" type=\"text/css\"/></head><body>";
        htmlString+="<table cellspacing='0' cellpadding='0' border='0' align='center'>";
        htmlString+="<tr><td align='center'>";
        htmlString+="<img src='images/"+imgName+".jpg' alt='' /></td</tr><tr><td>&nbsp;</td></tr><tr>";
        htmlString+="<td align='center'>";
        htmlString+="<input type=\"button\" id=\"btnClose\" value=\"Close\" class=\"button\" onclick=\"javascript:window.close()\" />";
        htmlString+="</td>";
        htmlString+="</tr></table></body></html>";
    newwindow.document.write(htmlString);
    newwindow.document.close();
    if (window.focus)
	{
		newwindow.focus();
	}
}