// Print window popup page creation.  Warning is displayed if Netscape is used,
// printer window is shown for Mozilla, IE, etc.
function print_it(){
image = document.the_image.src
OpenWindow=window.open("", "newwin", "height=650,width=600,toolbar=no,scrollbars=no,menubar=no,resizable=no,location=no,directories=no,status=no,screenX=100,screenY=75,left=100,top=75");
OpenWindow.document.write("<TITLE>Air Quality</TITLE>")
OpenWindow.document.write("<BODY BGCOLOR=#FFFFFF onLoad=window.print()>")
OpenWindow.document.write("<center><table width=515><tr><td>")
OpenWindow.document.write("<center>Air Quality Experimental Forecasts</center><br></td><td align=right>")
OpenWindow.document.write("<a href=javascript:window.print()><img src=../staticimages/print.gif border=0 height=21 width=25 alt=Print></a>")
OpenWindow.document.write(" <a href=javascript:self.close()><img src=../staticimages/exit1.gif border=0 height=35 width=33 alt=Close></a></td></tr></table>")
OpenWindow.document.write("<img src=" + image + ">")
OpenWindow.document.write("</center></BODY>")
OpenWindow.document.write("</HTML>")
OpenWindow.document.close()
}

// Popup window for Weather element definition
function wxWindow(linksite){
    popup = window.open(linksite,"","height=700,width=500,scrollbars=no");
}

// Function for weather element popup definitions
function cityWindow(linksite){
popup = window.open(linksite,"","height=600,width=520,scrollbars=yes,resize=yes");
}

// Generic popup window used for most element definitions
function topWindow(linksite){
   popup = window.open(linksite,"","height=300,width=360,scrollbars=yes");
}

// Popup window for "help" button
function HelpWindow(linksite){
    popup = window.open(linksite,"","height=600,width=625,scrollbars=yes,resize=yes");
}

// Popup window for "Key" button
function keyWindow(linksite){
    popup = window.open(linksite,"","height=600,width=820,scrollbars=yes,resize=yes");
}

function openPage(url) {
         window.open(url,"_parent");
}


// Function that handles the Daily/Weekly/Loop view tabs
function pageTypeSelect(view_choice) {
    if ( view_choice == "Day" )
    {
       tabpage =  sector + ".php#tabs" ;
    }
    else
    {
       tabpage =  sector + view_choice + ".php#tabs" ;
    }
    window.open(tabpage,"_parent");
}

// Function that handles the imagemap (*_map.php) files for zooming in
function pageZoomSelect(page_in) {
    if ( pagetype == "Day" )
    {
        // Day pages do not have the pagetype extension, just region.php
        go_page =  page_in + ".php#tabs" ;
    }
    else if ( pagetype == "Point" || pagetype ==  "Loop" )
    {
        go_page =  page_in + pagetype + ".php#tabs" ;
    }
    else
    {
        // Default to Day pages...
        go_page =  page_in + ".php#tabs" ;
    }
    window.open(go_page,"_parent");
}

// Function that handles directional navigation between sectors/regions/states/etc.
function navigate(nav_area) {
    if ( navpagetype == "Day" )
    {
        // Day pages do not have the navpagetype extension, just region.php
        navpage =  nav_area + ".php#tabs" ;
    }
    else
    {
        navpage =  nav_area + navpagetype + ".php#tabs" ;
    }
    window.open(navpage,"_parent");
}

