function wallpaper(page) {
msg=window.open(page,"","height=300,width=400,left=175,top=120,toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0");
}



var winheight=100
var winwidth=100
var Preview=null

step=1;

function Previewswindow(name,width,height,title) 
{
 
 if (!document.all)
 {
  if (!document.layers)
   {
    paramstp="height="+height+",width="+width+",top=10"+
    ",left=10,scrollbars=no,loPreviewion=no"+
    ",directories=no,status=no,menubar=no,toolbar=no,resizable=no"
    Preview=window.open("","Preview",paramstp);
    oldstr="<html><title>"+title+"</title><body background="+name+">"+"</b"+"ody></h"+"tml>";
    Preview.document.write(oldstr);
    if (Preview.focus){Preview.focus();}
    return;
    }
   else
   {
    LeftPosition=(screen.width)?(screen.width-width)/2:100;
    TopPosition=(screen.height)?(screen.height-height)/2:100;
    paramstp="height="+height+",width="+width+",top="+TopPosition+
    ",left="+LeftPosition+",scrollbars=no,loPreviewion=no"+
    ",directories=no,status=no,menubar=no,toolbar=no,resizable=no"
    Preview=window.open("","Preview",paramstp);
    loadpos=height/2-40
    string="<html><title>"+title+"</title><body bgcolor=black><div id=loadintxt style='position:absolute;top:"+loadpos+"px'></div>"
    string1='<s'+'cript>var animColorIndex=0;colorArray=["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000","#333333","#666666","#999999","#CCCCCC"];'
    string2='function textLooping(){if(animColorIndex==10)animColorIndex=0;document.loadintxt.document.open();'
    string3='document.loadintxt.document.write("<center><font size=4 face=Arial color="+colorArray[animColorIndex]+"><b>Loading...</b></font></center>");document.loadintxt.document.close();'
    string4='animColorIndex++;};animInterval=setInterval("textLooping()",200);</s'+'cript>'
    string5='<s'+'cript language="jav'+'ascript1.2">'
    string6="function init(){document.Previewpic.visibility='show';clearInterval(animInterval);document.loadintxt.visibility='hide';};"
    string7="</s"+"cript>"
    string8="<div id=Previewpic style='position:absolute;left:0px;top:0px;visibility:hidden'>"
    string9="<img src='"+name+"' width="+width+" height="+height+" border=0 onload='init()'></div></b"+"ody></h"+"tml>";
    Preview.document.writeln(string);
    Preview.document.writeln(string1);
    Preview.document.writeln(string2);
    Preview.document.writeln(string3);
    Preview.document.writeln(string4);
    Preview.document.writeln(string5);
    Preview.document.writeln(string6);
    Preview.document.writeln(string7);
    Preview.document.writeln(string8);
    Preview.document.writeln(string9);
    if(Preview.focus){Preview.focus();} 
    return;
   } 
 } 
  LeftPosition=(screen.width)?(screen.width-width)/2:100;
  TopPosition=(screen.height)?(screen.height-height)/2:100;
  paramstp="height="+winheight+",width="+winwidth+",top="+TopPosition+
  ",left="+LeftPosition+",scrollbars=no,loPreviewion=no"+
  ",directories=no,status=no,menubar=no,toolbar=no,resizable=no"
  Preview=window.open("","Preview",paramstp);
  string="<html><title>"+title+"</title><body topmargin=0 leftmargin=0 bgcolor=black>"
  string1="<div id=loadintxt style='position:absolute;width:100%;top:45%;text-align:center;visibility:visible;font-family:Comic Sans MS;font-size:16px;font-weight:bold'>Loading...</div>"
  string2="<div id=errtxt style='position:absolute;width:100%;top:45%;text-align:center;visibility:visible;font-family:Arial;font-size:16px;color:red;font-weight:bold;visibility:hidden'>ERROR!!! Please try again</div>"
  string3='<s'+'cript>'+'var animColorIndex=0;'+
  'colorArray=["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000","#333333","#666666","#999999","#CCCCCC"];'+
  'function textLooping(){if(animColorIndex==10)animColorIndex=0;'+
  'loadintxt.style.color=colorArray[animColorIndex];'+
  'animColorIndex++;}animInterval=setInterval("textLooping()",200);'
  string4='function erroccur(){clearInterval(animInterval);'+
  "loadintxt.style.visibility='hidden';"+
  "errtxt.style.visibility='visible';}"+'</s'+'cript>'
  string5='<s'+'cript language="jav'+'ascript1.2">'+
  'function init(){clearInterval(animInterval);'+
  "loadintxt.style.visibility='hidden';"+
  'fltr.filters.item(0).Apply();fltr.filters.item(0).Play();'+
  'fltr.style.visibility="visible";}'+'</s'+'cript>';
  string6='<img id="fltr" style="filter:BlendTrans(Duration=5);visibility:hidden" src="'+name+'" border=0'+
  ' width='+width+' height='+height+' onload="init()" onerror="erroccur()">'+
  '</b'+'ody></h'+'tml>';
  Preview.document.writeln(string);
  Preview.document.writeln(string1);
  Preview.document.writeln(string2);
  Preview.document.writeln(string3);
  Preview.document.writeln(string4);
  Preview.document.writeln(string5);
  Preview.document.writeln(string6);

  x = y = step
  while (x | y)
  {
	Preview.resizeBy (x, y)
	if (Preview.document.body.clientWidth >= width) x = 0
	if (Preview.document.body.clientHeight >= height) y = 0
  }
 if(Preview.focus){Preview.focus();} 
}

function ClosePreviewWin()
 {if(Preview!=null && Preview.open)Preview.close()}
 
window.onfocus=ClosePreviewWin;
