function openPreview(redir_to,item_name,site,confirmation){
//opens a preview window with the specified path
//pass the full file name
      //cut img name to load
      
            confirmed = true;
            site = blankNull(site);
            redir_full_fname = "";
            default_window_properties="200,200,resizeable,scrollbars";
         
            
            
            //if file is an image, it will be resized by DisplayPreview app
            if(item_name.indexOf("jpg")>-1){
                default_window_properties="0,0,resizeable,scrollbars";
            } 
            
           if(blankNull(redir_to) != ""){
                redir_full_fname = redir_to+".aspx?item="+item_name;
                
                if(confirmation=="true"){
                    //legal confirm is the full legal confirmation, kept in file '/js/site.js' 
                    if(typeof legalConfirm == 'undefined' || blankNull(legalConfirm)==""){
                    
                        confirmed = confirm(defaultLegal);
                    }
                    else {
                        confirmed = confirm(legalConfirm);
                    }
                }
               
               if(confirmed){                                     
     		      //  alert(redir_full_fname + default_window_properties);
     		      
     		      if (redir_full_fname.indexOf("player.aspx") > -1)
                        {
                            default_window_properties="height=450,width=675,resizeable,scrollbars";
                        }
                    url = redir_full_fname;
                       
                        previewWin = window.open(url,"preview",default_window_properties)
                       
               }
         }
}//end function openPreview(imgname)

function ImgNotLoaded(){
    resizeOuterTo(600,700);
    location.href = document.images[0].src;
}


function resizeOuterTo(w,h) {
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    top.outerWidth=w;
    top.outerHeight=h;
   }
   else top.resizeTo(w,h);
 }
}

function maxWindow() {
     window.moveTo(0,0);
     window.resizeTo(screen.width, screen.height);
}

d = new Date();
yearT = y2k(d.getFullYear());


//Legal Disclaimers for each site
document.write('<script language=javascript src="/js/site.js"></script>');


defaultLegal = "ALL PHOTOGRAPHY IS COPYRIGHTED MATERIAL. IMAGES ARE NOT TO BE ARCHIVED, DUPLICATED, RESOLD, RETRANSMITTED OR USED FOR ANY OTHER PURPOSES WITHOUT WRITTEN PERMISSION OF ABC, INC.\n\n";
defaultLegal += "All photographs are the copyrighted property of ABC, its affiliated companies or licensors and are distributed to the press solely for the promotion of ABC programming and the ABC Television Network in the news or entertainment media owned or legally licensed by your company within the United States.  No international distribution is permitted without permission.\n\n";
defaultLegal += "You will affix to any photograph, the copyright notice, and credit the photographer wherever possible: (Copyright \u00A9 "+ yearT+" ABC, Inc. / photographer's name)\n\n";
defaultLegal += "The photographs cannot be sold or distributed to a third party, provided however that syndicates receiving these materials may distribute them to their subscribers solely for distribution in the news or entertainment media.  The licensee does not have the right to grant to others, including affiliated or related websites, the right to use the photographs.PHOTOS MUST BE POSTED AT A LOW RESOLUTION IN ORDER TO PREVENT IMAGE DOWNLOADING.\n\n";
defaultLegal += "ABC reserves all right, title and interest to the photographs and no rights other than those limited rights specifically described herein are granted to you.  The photographs remain the property of ABC.  Any other use of the photographs is a violation of the copyright laws.";

