


function PopupPrintPage(intHeight, intWidth) {


	var strImageLibraryURL = window.location.href
	if(strImageLibraryURL.lastIndexOf("wcs01") > -1)
	{
		strImageLibraryURL = window.location.href + "=/PrintLayout=Y"
	} else {
		strImageLibraryURL = window.location.href + "&PrintLayout=Y"
	}

	window.open(strImageLibraryURL, '', 'scrollbars=yes,height=' + intHeight + ',width=' + intWidth + ',top=0,left=0,resizable=yes,toolbar=yes,titlebar=yes,menubar=yes');
}

function PopupImage(strImageURL, intHeight, intWidth, strTitle, strBgColor) {
	strImageURL = '<img src="' + strImageURL + '" alt="" onload="fitPic(this)" />';
	var intLeftPos = 0;
	var intTopPos = 0;
	var scrollbar = ',scrollbars=no';
	var resizable = ',resizable=yes'

	if (screen) {
		if( intWidth > (screen.width * 0.7) )
		{
			intWidth = screen.width * 0.7;
			scrollbar = ',scrollbars=yes' ;
			intHeight += 18;
		}
		if( intHeight > (screen.height * 0.7) )
		{
			intHeight = screen.height * 0.7;
			scrollbar = ',scrollbars=yes' ;
			intWidth += 18;
		}
		
		intLeftPos = (screen.width / 2) - (intWidth/2);
		intTopPos = (screen.height / 2) - (intHeight/2);
	}

	var newwin = window.open('', '', 'height=' + intHeight + ',width=' + intWidth + ',top=' + intTopPos + ',left=' + intLeftPos + resizable + scrollbar);
	
newwin.document.writeln('<?xml version="1.0" encoding="iso-8859-1"?>');
newwin.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
newwin.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml">');
newwin.document.writeln('<head>');
newwin.document.writeln('<title>' + (strTitle != null ? strTitle : 'Image Enlargement') + '</title>');
newwin.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />');


newwin.document.writeln('<scr' + 'ipt language="javascript">');
newwin.document.writeln('var NS = (navigator.appName=="Netscape")?true:false;');
//newwin.document.writeln('window.scrollbars.visible=false');
newwin.document.writeln('function fitPic(imageObj) {');
newwin.document.writeln('	iWidth = (NS)?window.innerWidth:document.body.clientWidth;');
newwin.document.writeln('	iHeight = (NS)?window.innerHeight:document.body.clientHeight;');

newwin.document.writeln('	intWidth = imageObj.width');
newwin.document.writeln('	intHeight = imageObj.height');
newwin.document.writeln('	if (screen) {');
newwin.document.writeln('		if( intWidth > (screen.width * 0.7) ) {');
newwin.document.writeln('			intWidth = screen.width * 0.7;');
newwin.document.writeln('		}');
newwin.document.writeln('		if( intHeight > (screen.height * 0.7) )	{');
newwin.document.writeln('			intHeight = screen.height * 0.7;');
newwin.document.writeln('		}');
newwin.document.writeln('		intLeftPos = (screen.width / 2) - (intWidth/2);');
newwin.document.writeln('		intTopPos = (screen.height / 2) - (intHeight/2);');
newwin.document.writeln('		window.moveTo(intLeftPos,intTopPos)');
newwin.document.writeln('	}');


newwin.document.writeln('	iWidth = intWidth - iWidth;');
newwin.document.writeln('	iHeight = intHeight - iHeight;');
newwin.document.writeln('	window.resizeBy(iWidth, iHeight-1);');
newwin.document.writeln('	self.focus();');
newwin.document.writeln('}');
newwin.document.writeln('</scr' + 'ipt>');


newwin.document.writeln('</head>');
newwin.document.writeln('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="' + ( strBgColor != null ? strBgColor : "#FFFFFF" ) + '">');
newwin.document.writeln(strImageURL);
newwin.document.writeln('</body>');
newwin.document.writeln('</html>');
}


function PopupFlash(strImageURL, intHeight, intWidth) {

	var intLeftPos = 0;
	var intTopPos = 0;
	var scrollbar = '';
	var resizable = '';
	if (screen) {
		if( intWidth > (screen.width * 0.7) )
		{
			intWidth = screen.width * 0.7;
			scrollbar = ',scrollbars=yes' ;
			intHeight += 18;
			resizable = ',resizable=yes'
		}
		if( intHeight > (screen.height * 0.7) )
		{
			intHeight = screen.height * 0.7;
			scrollbar = ',scrollbars=yes' ;
			intWidth += 18;
			resizable = ',resizable=yes'
		}
		
		intLeftPos = (screen.width / 2) - (intWidth/2);
		intTopPos = (screen.height / 2) - (intHeight/2);
	}
	
	var strFlash = strImageURL.replace(".jpg",".swf")

	var strURL = "/popupa.asp?strType=Flash&strImage=" + strImageURL + "&strFlash=" + strFlash + "&intHeight=" + intHeight + "&intWidth=" + intWidth
	window.open(strURL, '', 'height=' + intHeight + ',width=' + intWidth + ',top=' + intTopPos + ',left=' + intLeftPos + resizable + scrollbar);
}

function PopupWebPage(strURL, intHeight, intWidth) {

	window.open(strURL, '', 'scrollbars=yes,height=' + intHeight + ',width=' + intWidth + ',top=0,left=0,resizable=yes,toolbar=yes,titlebar=yes,menubar=yes');
}

function PopupWebPageBox(strURL, intHeight, intWidth) {

	window.open(strURL, '', 'scrollbars=no,height=' + intHeight + ',width=' + intWidth + ',top=0,left=0,resizable=no,toolbar=no,titlebar=no,menubar=no');
}


function PrintPage()
{
	setTimeout("window.print()",100)
}


