﻿function getPics(img){

	imgWin=window.open('about:blank','','scrollbars=no,resizable=no,width=150,height=100,left=10,top=10');

	with (imgWin.document){
		writeln('<html><head><title>Loading...<\/title><style type="text/css">body{margin:0px; background-color:#d1dae9;}<\/style>');
		writeln('<sc'+'ript type="text/javascript">');
		writeln('var isNN,isIE;');
		writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function Img_loaded(){ ');
		writeln('document.body.innerHTML=\'<img name=\"imgname\" src=\"/userfiles/image/gallery/'+img+'\" style=\"display:block\" alt=\"\" \>\'; } ');
		writeln('function reSizeToImage(){');
		writeln('if (isIE){');
		writeln('window.resizeTo(300,300);');
		writeln('width=300-(document.body.clientWidth-document.images[0].width);');
		writeln('height=300-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width,height);}');
		writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["imgname"].width;');
		writeln('window.innerHeight=document.images["imgname"].height;}}');
		writeln('function doTitle(){document.title="ASK";}');
		writeln('var img1 = new Image();');
		writeln('img1.src = "/userfiles/image/gallery/'+img+'";');
		writeln('img1.onload = new Function(" Img_loaded(); reSizeToImage(); doTitle(); self.focus(); ");');
		writeln('<\/sc'+'ript>');
		writeln('<\/head><body>');
		writeln('<div style="width:100%;height:100%;text-align: center;"><br /><br /><img src="/img/loader.gif" alt="Loading..." width="31" height="31" /></div>');
		writeln('<\/body><\/html>');
		close();		
	}
}