//zmienne
var strHTML = "";
var strHTML2 = "";
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 strFrom = "Kraj wyjazdowy:"
var strTo = "Kraj docelowy:";
var strButton = "&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 + "_h_l.png";
var midImg = "http://sale.euroticket.pl/combo/img/combo_" + comboColor + "_h_m.png";
var rightImg = "http://sale.euroticket.pl/combo/img/combo_" + comboColor + "_h_r.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 = "640px";
var t_height = "200px"

//kolory fontów
var Font1;
var Font2;
var Font3;
    if (comboColor == "dblue")
        {
        Font1 = "Yellow";
        Font2 = "White";
        Font3 = "White";
        }
    if (comboColor == "lblue")
        {
        Font1 = "DarkBlue";
        Font2 = "DarkBlue";
        Font3 = "DarkBlue";
        }
    if (comboColor == "steel")
        {
        Font1 = "Black";
        Font2 = "DarkBlue";
        Font3 = "Black";
        }
    if (comboColor == "yellow")
        {
        Font1 = "Black";
        Font2 = "Black";
        Font3 = "DarkBlue";
        }                   
        
// wygląd
document.writeln('<style> ');
document.writeln('.t_c1 {background-image: url(' + leftImg + ');} ');
document.writeln('.t_c1 {background-repeat: no-repeat;} ');
document.writeln('.t_c1 {height: 195px; width: 10px !important; position: absolute;} ');
document.writeln('.t_c1a {background-image: url(' + midImg + '); background-repeat: repeat-x;} ');
document.writeln('.t_c1a {height: 195px; } ');
document.writeln('.t_c2 {background-image: url(' + midImg + '); background-repeat: repeat-x;} ');
document.writeln('.t_c2 {background-repeat: repeat-x;} ');
document.writeln('.t_c2 {height: 195px; width: 350px;} ');
document.writeln('.t_c2a {background-image: url(' + midImg + '); background-repeat: repeat-x;} ');
document.writeln('.t_c2a {height: 195px; } ');

document.writeln('.t_c3 {background-image: url(' + rightImg + '); background-position-x: left;} ');
document.writeln('.t_c3 {background-repeat: no-repeat;} ');
document.writeln('.t_c3 {height: 195px; width: 232px;} ');
document.writeln('.t_inner {vertical-align: top; height: 185px; width: 100%; text-align: center;} ');
document.writeln('.ti_r1 {height: 19px;} ');
document.writeln('.ti_1c2 {color: ' + Font1 + '; font-family: Arial; font-size: 0.9em; font-weight: bold;} ');
document.writeln('.ti_1c2 a {color: ' + Font1 + '; font-family: Arial; font-size: 0.9em; font-weight: bold;} ');
document.writeln('.ti_2c2 {width: 200px;} ');
document.writeln('.ti_2c2 {color: ' + Font2 + '; font-family: Arial; font-size: 0.8em; font-weight: bold;} ');
document.writeln('.ti_3c2 {color: ' + Font2 + '; font-family: Arial; font-size: 0.8em; font-weight: bold;} ');
document.writeln('#et_actr {width: 150px;} ');
document.writeln('#et_dctr {width: 150px;} ');
document.writeln('.ti_1c4 {width: 232px;} ');
document.writeln('.nav {cursor: pointer; cursor: hand; } ');
document.writeln('.nav {width: 90px; height: 27px;} ');
document.writeln('.nav {background-image: url(' + buttonImg + '); background-repeat: no-repeat; } ');
document.writeln('.nav {color: White; font-weight: bold; font-size: 1em; font-family: Arial; } ');
document.writeln('.ti_4c3 {text-align: center; vertical-align: middle;} ');
document.writeln('.ti_5c2 a {color: ' + Font3 + '; font-weight: bold; font-size: 0.8em; font-family: Arial; } ');
document.writeln('.ti_5c3 a {color: ' + Font3 + '; font-weight: bold; font-size: 0.8em; font-family: Arial; } ');
document.writeln('</style> ');

// html
strHTML = strHTML + '<form name="ETX" action="http://sale.euroticket.pl/start.php?profile=' + profileName + '&cnt=cts" method="post" target="_blank">';
strHTML = strHTML + '<table id="t_main" class="t_main" border=0 cellpadding=0 cellspacing=0 width="' + t_width + '" height="' + t_height + '">';
strHTML = strHTML + '<tr class="t_r1"><td class="t_c1" id="tc_1"></td><td class="t_c1a" id="tc_1a">&nbsp;</td><td class="t_c2" >';
strHTML = strHTML + '<table class="t_inner" border=0><tr class="ti_r1"><td class="ti_1c1">';
strHTML = strHTML + '</td><td class="ti_1c2" colspan=2>';

strHTML2 = strHTML2 + '</td><td class="ti_1c4">&nbsp;</td></tr><tr class="ti_r2"><td class="ti_2c1">';
strHTML2 = strHTML2 + '<img class="t_arrow" src="' + arrowImg + '" /></td><td class="ti_2c2">';
strHTML2 = strHTML2 + strFrom + '</td><td class="ti_2c3"><script language="javascript">ShowTopCombo()</script>';
strHTML2 = strHTML2 + '</td><td class="ti_2c4"></td></tr><tr class="ti_r3">';
strHTML2 = strHTML2 + '<td class="ti_3c1"><img class="t_arrow" src="' + arrowImg + '" />';
strHTML2 = strHTML2 + '</td><td class="ti_3c2">' + strTo + '</td><td class="ti_3c3">';
strHTML2 = strHTML2 + '<script language="javascript">ShowBottomCombo();</script>';
strHTML2 = strHTML2 + '</td><td class="ti_3c4"></td></tr><tr class="ti_r4"><td class="ti_4c1">';
strHTML2 = strHTML2 + '</td><td class="ti_4c2"></td><td class="ti_4c3"><table><tr><td class="nav" onclick="document.ETX.submit();">';
strHTML2 = strHTML2 + strButton + '</td></tr></table></td><td class="ti_4c4"></td></tr><tr class="ti_r5">';
strHTML2 = strHTML2 + '<td class="ti_5c1"></td><td class="ti_5c2"><a href="' + strURL + profileName + '&cnt=log">' + strLog + '</a>';
strHTML2 = strHTML2 + '</td><td class="ti_5c3"><a href="' + strURL + profileName + '&cnt=log">' + strChange + '</a>';
strHTML2 = strHTML2 + '</td><td class="ti_5c4"></td></tr></table></td><td class="t_c2a" id="t_c2a">&nbsp;</td><td class="t_c3" ></td></tr></table></form>';                   

function showTop() {
document.write(strHTML);
}    
function showBottom() {
document.write(strHTML2);
}
function showDefaults() {
document.ETX.et_actr.value = strDefaultFrom;
document.ETX.et_dctr.value = strDefaultTo;
}
function setSize(ile)
{
document.getElementById("t_main").style.width = 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";
    }    
}                
                    
