// File Name:     SkytekOpenPhotoWindowFunctions.js
// Creation Date: 30.12.2004
// Author:        Adrian POPESCU


// Function used to display an image with a header text
// Creation Date: 30.12.2004
// Description: Click on link or thumbnail image to enlarge it.
// Example how to use it: 
// <a href="javascript:displayPhotoWindow('Window Title','Imge Name','Header Text')">Text or Img src.</a>

function displayPhotoWindow(windowTitle, imageName, headerText)
{
    PictureWindow = window.open("", "", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=100,height=50");
    PictureWindow.document.open();

    PictureWindow.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
    PictureWindow.document.write("<html><head><title>"+windowTitle+"</title>");
    PictureWindow.document.write("<META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
    PictureWindow.document.write("</head>");

    PictureWindow.document.write("<body topmargin='12' leftmargin='0' marginwidth='0' marginheight='0' onLoad='window.resizeTo(document.images[0].width+150,document.images[0].height+150)'>");
    PictureWindow.document.write("<center><h3>" + headerText + "</h3></center>");
    PictureWindow.document.write("<center><img src='" + imageName + "' border='0'></center>");
    PictureWindow.document.write("<br><center><form><input type=button onClick='self.close();' value='Close Picture'></form></center>");
    PictureWindow.document.write("</body></html>");
    
    PictureWindow.document.close();
}

// Function used to display an image with a header text 
// with scrollbars, and close window on picture click
// Creation Date: 30.12.2004
// Description: Click on link or thumbnail image to enlarge it.
// Example how to use it: 
// <a href="javascript:displayPhotoWindow('Window Title','Imge Name','Header Text')">Text or Img src.</a>

function displayPhotoWindow1(windowTitle, imageName, headerText)
{
    PictureWindow = window.open("", "", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width=100,height=50");
    PictureWindow.document.open();

    PictureWindow.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
    PictureWindow.document.write("<html><head><title>"+windowTitle+"</title>");
    PictureWindow.document.write("<!-- <script language=\"javascript\" src=\"js_files/SkytekCommonFunctions.js\"></script> //-->");
    PictureWindow.document.write("<META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
    PictureWindow.document.write("</head>");

    PictureWindow.document.write("<body topmargin='12' leftmargin='0' marginwidth='0' marginheight='0' onLoad='window.resizeTo(document.images[0].width+50,document.images[0].height+50)'>");
    PictureWindow.document.write("<center><form><input type=button value='Print' name='b_print' onClick='window.print();'>&nbsp;&nbsp;&nbsp;<input type=button name='b_close' onClick='self.close();' value='Close Picture'></form></center>");
    PictureWindow.document.write("<center><h3>" + headerText + "</h3></center>");
    PictureWindow.document.write("<center><a href='' title='Close Window on Click'><img src='" + imageName + "' border='0', onClick='self.close();'></a></center>");
    //PictureWindow.document.write("<center><form><input type=button onClick='self.close();' value='Close Picture'></form></center>");
    PictureWindow.document.write("</body></html>");

    PictureWindow.document.close();
}

function openNewWindow(strURL, windowTitle, features)
{
    window.open(strURL,windowTitle,features);
    //var video_dup_form1 = open(strURL,windowTitle,features);
    //video_dup_form1.document.bgColor = 'lightgreen';
}

// Used for Cover Gallery to pass as argument the current window object "this" and the number of current material
// materialId: current material Id
// coverType : Cover Gallery "0", or Custom Cover Gallery "1"
//             coverType - is not used yet, there are two functions used(setSelectedCover(coverNr) and setSelectedCustomCover(coverNr))
//             The coverType can be saved like material ID using cookie.
function openNewWindow1(strURL, windowTitle, features, materialId, coverType)
{
    setMaterialId(materialId);
    window.open(strURL,windowTitle,features);
}

// Used to set the selected Cover Id to video duplication form,
// accordingly to material section from which was opened
function setSelectedCover(coverNr)
{
    var matId = getMaterialId();
    if(window.opener.document.forms[0] != null)
    {
        window.opener.document.forms[0].elements["upgrade_5_"+matId+"_1"].value = coverNr;
        self.close();
    }

}

// Used to set the selected Custom Cover Id to video duplication form,
// accordingly to material section from which was opened
function setSelectedCustomCover(coverNr)
{
    var matId = getMaterialId();
    if(window.opener.document.forms[0] != null)
    {
        window.opener.document.forms[0].elements["upgrade_5_"+matId+"_2"].value = coverNr;
        self.close();
    }
}

// Open a new window with the content depending of selectors ( used for FAQ and Testimonies - no links to Home page,
// from Logo picture and Header picture needed - for this use displaySkytekHeader1(WindowObj); )
function openNewWindowWithHeader(strURL, windowTitle, features, selector1, selector2, selector3)
{
    // selector1: store Question Number

    // selector2: store Question Category
    // Value 1 - FAQ Professional Videography
    // Value 2 - FAQ VIDEO Conversions, Duplications, Transfers
    // Value 3 - FAQ VIDEO Editing

    // selector3: Cover Inserts Photo Gallery.

    // window.open(strURL,windowTitle,features);
    NewWindowOpen = window.open(strURL,'',features);
    NewWindowOpen.document.open();

    NewWindowOpen.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");

    // Set the Window Title in the <head> section
    // because: I don't know why in open method are not allowed spaces in Title name
    NewWindowOpen.document.write("<html><head><title>"+windowTitle+"</title>");
    NewWindowOpen.document.write("<!-- <script language=\"javascript\" src=\"js_files/SkytekOpenPhotoWindowFunctions.js\"></script> //-->");
    NewWindowOpen.document.write("<META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
    
    NewWindowOpen.document.write("</head>");

    NewWindowOpen.document.write("<body topmargin='12' leftmargin='0' marginwidth='0' marginheight='0'>");

    // Display the Skytek Header with logo - without links to Home page
    displaySkytekHeader1(NewWindowOpen);

    // Print an empty line
    NewWindowOpen.document.write("<br>");

    if(selector1 != '')
    {
        // Display Selected FAQ
        displayFaq(NewWindowOpen, selector1, selector2, selector3);
    }
    //NewWindowOpen.document.write("");
    NewWindowOpen.document.write("<br><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td align='center'><form><input type=button onClick='self.close();' value='Close Window'></form></td></tr></table>");
    NewWindowOpen.document.write("</body></html>");

    NewWindowOpen.document.close();
}

function displayVideoWindow(windowTitle, movieName, headerText, widthWin, heightWin)
{
    VideoWindow = window.open("", "", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0," + "width=" + widthWin + ",height=" + (heightWin+100));
    VideoWindow.document.open();

    VideoWindow.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
    VideoWindow.document.write("<html><head><title>"+windowTitle+"</title>");
    VideoWindow.document.write("<META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
    VideoWindow.document.write("</head>");

    VideoWindow.document.write("<body topmargin='12' leftmargin='0' marginwidth='0' marginheight='0'>");
    VideoWindow.document.write("<center><h3>" + headerText + "</h3></center>");

    VideoWindow.document.write("<OBJECT classid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" CODEBASE=\"http://activex.microsoft.coam/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112\" TYPE=\"application/x-oleobject\"");
    VideoWindow.document.write(" width=\"" + widthWin + "\" height=\"" + heightWin + "\" standby=\"Loading Microsoft Windows Media Player components...\" ID=\"MediaPlayer\">");
    VideoWindow.document.write("<PARAM NAME=\"FileName\" value=\"video_gal/" + movieName + "\"><PARAM NAME=\"ShowStatusBar\" VALUE=\"true\"><PARAM NAME=\"TransparentatStart\" VALUE=\"true\">");
    VideoWindow.document.write("<PARAM NAME=\"AutoStart\" VALUE=\"true\"><PARAM NAME=\"ShowControls\" VALUE=\"true\">");
    VideoWindow.document.write("<Embed SRC=\"video_gal/" + movieName + "\" Width=" + widthWin + " Height=" + heightWin + " autostart=\"true\" showstatusbar=\"true\" TYPE=\"application/x-mplayer2\" ");
    VideoWindow.document.write("pluginspage=\"http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&\" ");
    VideoWindow.document.write("ShowControls=\"true\" filename=\"video_gal/" + movieName + "\" transparentatstart=\"true\"></embed></OBJECT>");

    VideoWindow.document.write("<br><center><form><input type=button onClick='self.close();' value='Close Window'></form></center>");
    VideoWindow.document.write("</body></html>");

    VideoWindow.document.close();
}

// Function used to display the Header
// Creation Date: 19.03.2005
// Description: Change the Header here and will be replaced within all site.
// Example how to use it:
// <script language="javascript">displaySkytekHeader();</script>

function displaySkytekHeader(WindowObject)
{
    //The Header (above the menu);
    WindowObject.document.write("<table height='67' width='800'><tr><td align='center' width='51' height='67' valign='top'>");
    
    // If the page is check_av.php and the "title" of the page is "Check Availability - Skytek",
    // then the immages are accessed from "php_file" folder(this mean "../images" in place of "images/").
    if(WindowObject.document.title == "Check Availability - Skytek")
    {
        WindowObject.document.write("<a href='../index.html' title='Home - Skytek Productions'><img src='../images/Sigla.jpg' width='80' height='80' border='0'></a>");
    }
    else
    {
        WindowObject.document.write("<a href='index.html' title='Home - Skytek Productions'><img src='images/Sigla.jpg' width='80' height='80' border='0'></a>");
    }

    WindowObject.document.write("</td><td height='67' align='left' valign='middle'><table width='100%' border='0' cellspacing='0' cellpadding='0'>");
    WindowObject.document.write("<tr><td>");

    if(WindowObject.document.title == "Check Availability - Skytek")
    {
        WindowObject.document.write("<a href='../index.html' title='Home - Skytek Productions'><img src='../images/Skytek_Header_Name.gif' width='620' height='60' border='0'></a>");
    }
    else
    {
        WindowObject.document.write("<a href='index.html' title='Home - Skytek Productions'><img src='images/Skytek_Header_Name.gif' width='620' height='60' border='0'></a>");
    }

    WindowObject.document.write("</td></tr><tr align='right' valign='top' bgcolor='#999999'>");
    WindowObject.document.write("<td><b><i><font color='#FFCC00'>Y o u r&nbsp; V i d e o&nbsp; P r o f e s s i o n a l s </font></i></b></td>");
    WindowObject.document.write("</tr></table>");
    WindowObject.document.write("</td></tr></table>");
}

// Function used to display the Header without links to home page in header and logo
// Creation Date: 19.03.2005
// Description: Change the Header here and will be replaced within all site.
// Example how to use it:
// <script language="javascript">displaySkytekHeader1(WindowObject);</script>

function displaySkytekHeader1(WindowObject)
{
    //The Header (above the menu);
    WindowObject.document.write("<table height='67' width='800'><tr><td align='center' width='51' height='67' valign='top'>");

    // If the page is check_av.php and the "title" of the page is "Check Availability - Skytek",
    // then the immages are accessed from "php_file" folder(this mean "../images" in place of "images/").
    if(WindowObject.document.title == "Check Availability - Skytek")
    {
        WindowObject.document.write("<img src='../images/Sigla.jpg' width='80' height='80' border='0'>");
    }
    else
    {
        WindowObject.document.write("<img src='images/Sigla.jpg' width='80' height='80' border='0'>");
    }

    WindowObject.document.write("</td><td height='67' align='left' valign='middle'><table width='100%' border='0' cellspacing='0' cellpadding='0'>");
    WindowObject.document.write("<tr><td>");

    if(WindowObject.document.title == "Check Availability - Skytek")
    {
        WindowObject.document.write("<img src='../images/Skytek_Header_Name.gif' width='620' height='60' border='0'>");
    }
    else
    {
        WindowObject.document.write("<img src='images/Skytek_Header_Name.gif' width='620' height='60' border='0'>");
    }

    WindowObject.document.write("</td></tr><tr align='right' valign='top' bgcolor='#999999'>");
    WindowObject.document.write("<td><b><i><font color='#FFCC00'>Y o u r&nbsp; V i d e o&nbsp; P r o f e s s i o n a l s </font></i></b></td>");
    WindowObject.document.write("</tr></table>");
    WindowObject.document.write("</td></tr></table>");

}

// Function used to display the Header message
// Creation Date: 17.01.2005
// Description: Change the text here and will be replaced within all site.
// Example how to use it:
// <script language="javascript">displayHeaderMessage();</script>

function displayHeaderMessage()
{
    // Uncoment next lines to display a mesage in the Header (above the menu);
    //document.write('<table cellspacing=0 cellpadding=0 width=550 border=0><tr valign=bottom align=center><td>');
    // Here you can display anny message in the Header (above the menu);
    //document.write('Your formated Message!!!');
    //document.write('</td></tr></table>');

    // Uncoment next 2 lines to display the message "100% Digital"
    //document.write('<table cellspacing=0 cellpadding=0 width=550 border=0><tr valign=bottom align=center><td><b><font color=#0000ff size=2>');
    //document.write('100% DIGITAL</font> <font color=#ff0000 size=3>&amp; OUR COMMITMENT TO QUALITY &amp;</font> <font color=#0000ff size=2>100% DIGITAL</font></b></td></tr></table>');
}

// Function used to display the DropBox address
// Creation Date: 30.12.2004
// Description: Change the text here and will be replaced within all site.
// Example how to use it:
// <script language="javascript">displayDropBoxAddress();</script>

function displayDropBoxAddress()
{
    document.write('132 East, 43rd Str, New York, NY 10017');
}

// Function used to display the Telephone, Fax and E-mail address
// Creation Date: 30.12.2004
// Description: Change the text here and will be replaced within all site.
// Example how to use it:
// <script language="javascript">displayTelFaxEmailAddress();</script>

function displayTelFaxEmailAddress()
{
    document.write('Tel: 718.429-5904&nbsp;&nbsp;&nbsp;&nbsp;Fax: 718.670.9934&nbsp;&nbsp;&nbsp;&nbsp;Email:support@skytekproductions.com');
}

// Function used to display the Copyright Info
// Creation Date: 05.01.2005
// Description: Change the text here and will be replaced within all site.
// Example how to use it:
// <script language="javascript">displayCopyrightInfo();</script>

function displayCopyrightInfo()
{
    document.write('<font color=#000000 size=2> Copyright © 2005 Skytek Productions Inc. All Rights Reserved.</font>');
}

// Function used to display "Terms and Conditions"
// Creation Date: 05.01.2005
// Description: Change the text here and will be replaced within all site.
// Example how to use it:
// <script language="javascript">displayTermsAndConditions();</script>

function displayTermsAndConditions()
{
    document.write("<b><i><font size='2' color='#0000FF'><a href=\"javascript:openNewWindow('terms.htm','TermsAndConditions','scrollbars=1,resizable=1,,width=830,height=450')\">Terms and Conditions</a></font></i></b>");
}

// Function used to display Terms and Conditions for Check Availability page,
// which is located in "php_files" folder and the path to terms.htm file is one level up "../"
// Creation Date: 16.01.2005
function displayTermsAndConditions_Check_Availability()
{
    document.write("<b><i><font size='2' color='#0000FF'><a href=\"javascript:openNewWindow('../terms.htm','TermsAndConditions','scrollbars=1,resizable=1,,width=830,height=450')\">Terms and Conditions</a></font></i></b>");
}

// Function used to display Under Construction message for Skytek Start Page page,
// Creation Date: 24.02.2005
// Description: Change the text here and will be replaced within all site.
// Example how to use it:
// <script language="javascript">displayUnderConstructionMessage();</script>

function displayUnderConstructionMessage()
{
    document.write('<b><font face="Arial" size="5" color="#FF0000">Under Construction!&nbsp;&nbsp;&nbsp;Under Construction!&nbsp;&nbsp;&nbsp;Under Construction!&nbsp;&nbsp;&nbsp;</font></b>');
}
