﻿//zmienne
var Andrew = "";
var strHTML = "";
var strHTML2 = "";
var strMarqueeText = "";
var strMakeList = "";
var strList = "";
var strList2 = "";
var strWidget = "";
var strAdvert = "";
var Navigate = "_blank";
var profileName = document.getElementById("combo").getAttribute("src");
profileName = profileName.replace("http://interia_genctr.euroticket.pl/genctr/","");
profileName = profileName.replace("http://sale.euroticket.pl/genctr/","");
profileName = profileName.replace(".js","");

var comboColor = document.getElementById("params").getAttribute("xml:space");
var test_test = document.location.href;
    if (test_test.indexOf("testtest") != -1)
        {
            test_switch();
        }

var strMarqTitle = "Zapraszamy do zakup&oacute;w bilet&oacute;w";
var strFrom = "Kraj wyjazdowy:"
var strTo = "Kraj docelowy:";
var strButton = "&nbsp;&nbsp;&nbsp;&nbsp;Dalej";
var strLog = "Tw&oacute;j bilet";
var strURL = "http://sale.euroticket.pl/start.php?profile=";
var strChange = "Zmiany na bilecie";
var strDefaultFrom = "636";
var strDefaultTo = "23742";

//obrazki
var leftImg = "http://sale.euroticket.pl/combo/img/combo_" + comboColor + "_wl_t.png";
var midImg = "http://sale.euroticket.pl/combo/img/combo_" + comboColor + "_wl_m.png";
var rightImg = "http://sale.euroticket.pl/combo/img/combo_" + comboColor + "_wl_b.png";

var arrowImg = "http://sale.euroticket.pl/combo/img/arrow_h_" + comboColor + ".png";
var buttonImg = "http://sale.euroticket.pl/combo/img/rightnavigator_over.png";

var t_width = "450px";
var t_height = "200px"
var BottomHeight = "171px";
document.write('<script id="lista" src="http://sale.euroticket.pl/combo/combo_promo_list_pl.js" type="text/javascript"></script>');
//kolory font�w
var Font1;
var Font2;
var Font3;
var Marq1;
var Marq2;
var Marq3;
    if (comboColor == "dblue")
        {
        Font1 = "Yellow";
        Font2 = "White";
        Font3 = "White";
        Marq1 = "Yellow";
        Marq2 = "White";
        Marq3 = "Red";
        }
    if (comboColor == "lblue")
        {
        Font1 = "DarkBlue";
        Font2 = "DarkBlue";
        Font3 = "White";
        Marq1 = "DarkBlue";
        Marq2 = "Red";
        Marq3 = "DarkBlue";
        }
    if (comboColor == "steel")
        {
        Font1 = "Black";
        Font2 = "DarkBlue";
        Font3 = "White";
        Marq1 = "Red";
        Marq2 = "Black";
        Marq3 = "Red";
        }
    if (comboColor == "yellow")
        {
        Font1 = "Black";
        Font2 = "Black";
        Font3 = "White";
        Marq1 = "DarkBlue";
        Marq2 = "Black";
        Marq3 = "DarkBlue";
        }                   

        
// wygl�d
var l_string = "";
var l_grid1 = "";
var l_grid2 = "";

// we� list� do reklam
MarqueeText()

// Andrew:  style dla klas
l_string = l_string + '<style>';
l_string = l_string + '.c_container {margin-left: 0em; margin-right: 0em;}';
l_string = l_string + '.c_top {background-image: url(' + leftImg + '); background-repeat: no-repeat; height: 12px; width: 187px; position: absolute;}';
l_string = l_string + '.c_topa {background-image: url(' + midImg + '); background-repeat: repeat-y; height: 13%; width: 187px; }';
l_string = l_string + '.c_mid {background-image: url(' + midImg + '); background-repeat: repeat-y; width: 187px; }';
l_string = l_string + '.c_mid {vertical-align: middle;}';
l_string = l_string + '.c_mida {background-image: url(' + midImg + '); background-repeat: repeat-y; height: 13%; width: 187px; }';

l_string = l_string + '.c_bot {background-image: url(' + rightImg + '); background-repeat: no-repeat; height: '+ BottomHeight + '; width: 187px; height: 171px; }';
l_string = l_string + '.t_top {}';
l_string = l_string + '.t_mid {}';
l_string = l_string + '.t_bot {}';
l_string = l_string + '.mid_container {margin-left: 15px; width: 160px;}'
l_string = l_string + '.mid_c1 {font-size: 12px; color: ' + Font2 + '; font-weight: bold; font-family: Arial; }';
l_string = l_string + '.mid_c2 {font-size: 12px; color: ' + Font2 + '; font-weight: bold; font-family: Arial; }';
l_string = l_string + '.mid_c0 a {font-size: 14px; color: ' + Font1 + '; font-weight: bold; font-family: Arial; }';
l_string = l_string + '.mid_c0 a {text-decoration: none; cursor: text; }'
//l_string = l_string + '.marquee1 {font-size: 11.3555px; color: ' + Marq1 + '; font-family: Arial; }';
//l_string = l_string + '.marquee1 a {font-size: 11.3555px; color: ' + Marq1 + '; font-family: Arial; }';
//l_string = l_string + '.marquee1 a {text-decoration: none; color: ' + Marq1 + ';}';
l_string = l_string + '.marquee2 {font-size: 14px; color: ' + Marq2 + '; font-weight: bold; font-family: Arial; }';
l_string = l_string + '.marquee2 a{font-size: 14px; color: ' + Marq2 + '; font-weight: bold; font-family: Arial; }';
l_string = l_string + '.marquee2 a {text-decoration: none; color: ' + Marq2 + ';}';
l_string = l_string + '.marquee3 {font-size: 11.3555px; color: ' + Marq3 + '; font-family: Arial; }';
l_string = l_string + '.marquee3 a{font-size: 11.3555px; color: ' + Marq3 + '; font-family: Arial; }';
l_string = l_string + '.marquee3 a{text-decoration: none; color: ' + Marq3 + ';}';
l_string = l_string + '.mid_c1button {cursor: pointer; cursor: hand; text-align: left; color: ' + Font3 + '; font-weight: bold; font-family: Arial; font-size: 14px;}';
l_string = l_string + '.mid_c1button {background-image: url(' + buttonImg + '); background-repeat: no-repeat; height: 27px; width: 90px; vertical-align: middle; }';
l_string = l_string + '.breakA {color: White;}';
l_string = l_string + '</style>';


// Andrew: layout dla gad�etu
l_grid1 = '<form name="ETX" action="' + strURL + profileName + '&cnt=cts" method="POST" target="_blank">';
l_grid1 = l_grid1 + '<table cellpadding=0 cellspacing=0 border=0 class="c_container" id="t_main" >';
l_grid1 = l_grid1 + '<tr class="t_top"><td class="c_top" ></td></tr>';
l_grid1 = l_grid1 + '<tr class="t_topa"><td class="c_topa" ></td></tr>';
l_grid1 = l_grid1 + '<tr class="t_mid"><td class="c_mid">';
l_grid1 = l_grid1 + '<table border=0 class="mid_container">';
l_grid1 = l_grid1 + '<tr><td class="mid_c0" colspan=2><a target="' + Navigate + '" href="' + strURL + profileName + '">';

l_grid2 = l_grid2 + '</a><br /><br /></td><td class="mid_c2"></td></tr>';
l_grid2 = l_grid2 + '<tr><td class="mid_c1" colspan=2>';
l_grid2 = l_grid2 + strFrom;
l_grid2 = l_grid2 + '</td><td class="mid_c2"></td></tr>';
l_grid2 = l_grid2 + '<tr><td class="mid_c1" colspan=2>';
l_grid2 = l_grid2 + '<script language="javascript">ShowTopCombo()</script>';
l_grid2 = l_grid2 + '<br /><br /></td><td class="mid_c2"></td></tr>';
l_grid2 = l_grid2 + '<tr><td class="mid_c1" colspan=2>' + strTo + '</td>';
l_grid2 = l_grid2 + '<td class="mid_c2"></td></tr><tr>';
l_grid2 = l_grid2 + '<td class="mid_c1" colspan=2>';
l_grid2 = l_grid2 + '<script language="javascript">ShowBottomCombo()';
l_grid2 = l_grid2 + '</script><br/>&nbsp;</td><td class="mid_c2"></td></tr>';
l_grid2 = l_grid2 + '<tr><td class="mid_c1button" colspan=2 align="center"';
//l_grid2 = l_grid2 + '<img src="' + buttonImg + '" onmouseover=""';
l_grid2 = l_grid2 + ' onclick="document.ETX.submit();" />' + strButton + '<br /><br />';
l_grid2 = l_grid2 + '</td><td class="mid_c2button"></td></tr>';

    
    
var SelWidth = "150px"   
   
function showTop() {
doFinalize();
document.write(l_grid1);

}    

function showBottom() {
document.write(l_grid2);

document.getElementById("et_dctr").style.width=SelWidth;
document.getElementById("et_actr").style.width=SelWidth;
}

function showDefaults() {
document.getElementById("et_dctr").value = strDefaultFrom;
SetBottomCombo(document.getElementById("et_dctr"));
document.getElementById("et_actr").value = strDefaultTo;

}
document.write(l_string);


function MarqueeText()
{

//strMakeList = "document.writeln(\"" + strMakeList + "\");";
//document.writeln(strMarqueeText);
strList2 = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
strList2 = strList2 + strMakeList;
}
                
function doFinalize()
{
strMakeList = strMakeList + strList;
strMakeList = strMakeList.replace(/FullLink/g, strURL + profileName + "&cnt=swr");
strList = strMakeList.replace(/<br\/><br\/>/g, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");

strMakeList = strList2;
strMakeList = strMakeList.replace(/FullLink/g, strURL + profileName + "&cnt=swr");
strList2 = strMakeList.replace(/<br\/><br\/>/g, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");

if (strList.length != 0)
    {
  l_grid2 = l_grid2 + '<tr><td class="mid_marquee1" colspan=2>';
  //l_grid2 = l_grid2 + '<marquee class="marquee1" onmouseover="this.stop();" onmouseout="this.start();">' + strList + '</marquee>';
  l_grid2 = l_grid2 + '</td><td class="mid_c2button"></td></tr>';  
    
    }
    
    if (strAdvert.length != 0)
    {
  l_grid2 = l_grid2 + '<tr><td class="mid_marquee1" colspan=2>';
  l_grid2 = l_grid2 + '<marquee class="marquee2" onmouseover="this.stop();" onmouseout="this.start();">' + strAdvert + '</marquee>';
  l_grid2 = l_grid2 + '</td><td class="mid_c2button"></td></tr>';  
    
    }
    if (strList2.length != 0)
    {
  l_grid2 = l_grid2 + '<tr><td class="mid_marquee1" colspan=2>';
  //l_grid2 = l_grid2 + '<marquee class="marquee1" onmouseover="this.stop();" onmouseout="this.start();">' + strList2 + '</marquee>';
  l_grid2 = l_grid2 + '</td><td class="mid_c2button"></td></tr>';  
    
    }
l_grid2 = l_grid2 + '</table></td></tr><tr class="t_mida"><td class="c_mida"></td></tr><tr class="t_bot"><td class="c_bot"></td></tr>';
l_grid2 = l_grid2 + '</table>';
l_grid2 = l_grid2 + '</form>';
}      
function setSize(ile)
{
document.getElementById("t_main").style.height = ile;
}       

function test_switch()
{
if (test_test.indexOf("dblue") != -1)
    {
        comboColor = "dblue";
    }
if (test_test.indexOf("lblue") != -1)
    {
        comboColor = "lblue";
    }    
if (test_test.indexOf("steel") != -1)
    {
        comboColor = "steel";
    }    
 if (test_test.indexOf("yellow") != -1)
    {
        comboColor = "yellow";
    }    
}       
