// JavaScript Document
/* reated by adam robertson. Last modified on 2/16/11  */





/*   The function NewWindow opens a new window to display gallery item...useful for Flash things*/

function NewWindow(mypage,myname,w,h,scroll,title,fileType)

{

w=(document.all&&!window.opera)? w-2 : w

h=(document.all&&!window.opera)? h-2 : h

var ieDif=(document.all&&!window.opera)? 2 : 0

LeftPosition = (window.innerWidth&&window.opera)? (window.innerWidth-w)/2 :(screen.width) ? (screen.width-w)/2 : 0;

TopPosition = (window.innerHeight&&window.opera)? (window.innerHeight-h)/2 :(screen.height) ? (screen.height-h)/2 : 0;

TopPosition=TopPosition<0? 0 : TopPosition

settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=0,status=0'

win = window.open('',myname,settings)

win.document.write('<link rel="stylesheet" type="text/css"  href="style.css" title="second"/> <title>'+title+' - Close Window to Exit<\/title>');

win.document.write('<body text="#000000" style="margin:10px;padding:0;overflow:hidden;"> <div class="gallery"> ');



  if (fileType="swf")  //added this IF statement because the flash project had to be written a little differently than the jpg images

    {     

	 win.document.write('<object type="application/x-shockwave-flash" width="'+(w-20+ieDif)+'" height="'+(h-20+ieDif)+'" galleryimg="no" title="'+title+'" data="'+mypage+' ></object>');

	 win.document.write('</div> <!-- close gallery --> </body>');

     win.document.close();

     win.focus();

    }

	

   else

	{

     win.document.write('<img width="'+(w-20+ieDif)+'" height="'+(h-20+ieDif)+'" galleryimg="no" title="'+title+'" src="'+mypage+'">');

     win.document.write('</div> <!-- close gallery --> </body>');

     win.document.close();

     win.focus();

	}

}
