//zmienne
var strHTML = "";
var strHTML2 = "";
var strMarqueeText = "";
var strMakeList = "";
var strList = "";
var strList2 = "";
var strList3 = "";
var strWidget = "";
var strAdvert = "";
var profileName = document.getElementById("combo").getAttribute("src");
profileName = profileName.replace("http://sale.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";
strMarqTitle = "";
var strFrom = "Departure country:"
var strTo = "Arrival country:";
var strButton = "&nbsp;&nbsp;&nbsp;Next";
var strLog = "Your ticket";
var strURL = "http://sale.euroticket.pl/start.php?profile=";
var strChange = "Ticket changes";

var strDefaultFrom = "636";
var strDefaultTo = "23742";


//obrazki
var leftImg = "http://sale.euroticket.pl/combo/img/combo_" + comboColor + "_hl_l.png";
var midImg = "http://sale.euroticket.pl/combo/img/combo_" + comboColor + "_hl_m.png";
var rightImg = "http://sale.euroticket.pl/combo/img/combo_" + comboColor + "_hl_ra.png";
var rightRImg = "http://sale.euroticket.pl/combo/img/combo_" + comboColor + "_hl_rr.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 = "680px";
var t_height = "200px"

document.write('<script id="lista" src="http://sale.euroticket.pl/combo/combo_promo_list_en.js" type="text/javascript"></script>');
//document.write('<script id="lista" src="combo_promo_list_en.js" type="text/javascript"></script>');
//kolory fontów
var Font1;
var Font2;
var Font3;
var OddColor;
var EvenColor;
var LogoImg;

    if (comboColor == "dblue")
        {
        Font1 = "Yellow";
        Font2 = "White";
        Font3 = "White";
        OddColor = "#E4E9F0";
        EvenColor = "White";
        LogoImg = "http://sale.euroticket.pl/combo/img/powered.png";
        
        }
    if (comboColor == "lblue")
        {
        Font1 = "DarkBlue";
        Font2 = "Black";
        Font3 = "DarkBlue";
        OddColor = "#E4E9F0";
        EvenColor = "White";
        LogoImg = "http://sale.euroticket.pl/combo/img/powered.png";
        }
    if (comboColor == "steel")
        {
        Font1 = "Black";
        Font2 = "Black";
        Font3 = "Black";
        OddColor = "LightGrey";
        EvenColor = "White";
        LogoImg = "http://sale.euroticket.pl/combo/img/powered.png";
        }
    if (comboColor == "yellow")
        {
        Font1 = "Black";
        Font2 = "Black";
        Font3 = "DarkBlue";
        OddColor = "LightGrey";
        EvenColor = "White";
        LogoImg = "http://sale.euroticket.pl/combo/img/powered.png";
        }                   
//Marquee
var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight='';
        
// wyglad
document.writeln('<style> ');
document.writeln('.trowodd {background: ' + OddColor + ';}');
document.writeln('.troweven {background: ' + EvenColor + ';}');
document.writeln('.tadds {width: 100%;}');
document.writeln('.timg {width: 34px; background-image: url(' + LogoImg + '); background-repeat: no-repeat;}');
document.writeln('.cTableMain {width:865px; height:187px;}');
document.writeln('.cTableInner {width:180px;}');
document.writeln('.cities {text-decoration: none;}');
document.writeln('.cityName {font-family:Arial; font-weight:bold; font-size: 11px; color:Blue;}');

document.writeln('.cityFrom {font-family:Arial; font-size:11px; color:Blue;}');
document.writeln('.cityPrice {font-family:Arial; font-weight:bold; font-size: 11px; color:Red;}');
document.writeln('.box_top_title_r1 {font-family:Arial; font-weight:bold; font-size: 11px; color:Blue;}');
document.writeln('.tGadgetTitle {font-family:Arial; font-size: 13; color: White; font-weight:bold;}');
document.writeln('.r1_c1 {background-image: url(' + leftImg + '); height: 187px; width: 185px !important; background-repeat:no-repeat;}');
document.writeln('.adjust {width: 12% !important; }');
document.writeln('.r1_c2 {background-image: url(' + midImg + '); height: 187px; background-repeat: repeat-x;}');
document.writeln('.r1_c3 {background-image: url(' + rightImg +'); height: 187px; width: 177px; background-repeat:no-repeat;}');

document.writeln('.r1_c4 {background-image: url(' + rightRImg +'); height: 187px; width: 8px !important; background-repeat:no-repeat;}');

document.writeln('.t_marquee {width: 200px; height: 142px;}');
document.writeln('.t_combo {width: 100%;}');
document.writeln('.tm1_c1 {width: 13%; height: 15px;}');
document.writeln('.tm1_c2 {font-family:Arial; font-weight:bold; font-size: 0.6em; color:Blue;}');
document.writeln('.tm1_c3 {width: 7%;}');
document.writeln('.tm2_c2 {height: 100px;}');
document.writeln('.r1_c2 {vertical-align: top; }');
document.writeln('.tc1_c1 {height: 35px; font-family:Arial; font-size: 13px; color: ' + Font1 + '; font-weight: bold; text-align: center; }');
document.writeln('.tc1_c1 a {font-family:Arial; font-size:0.9em; color: ' + Font1 + '; font-weight: bold;}');
document.writeln('.tc2_c1 {height: 35px; font-family:Arial; font-size: 11px; color: ' + Font2 + '; text-align: left; }');
document.writeln('.tc3_c1 {height: 35px; font-family:Arial; font-size: 11px; color: ' + Font2 + '; text-align: left; }');
document.writeln('#et_dctr {width: 170px;}');
document.writeln('#et_actr {width: 170px;}');
document.writeln('.tc4_c1 {height: 35px; text-align: center;}');
document.writeln('.t_navigate {width: 90px; height: 27px; cursor: pointer; cursor: hand;}');
document.writeln('.t_navigate_c {background-image: url(http://sale.euroticket.pl/combo/img/rightnavigator_over.png); width: 90px; height: 27px; cursor: pointer; cursor: hand;}');
document.writeln('.t_navigate_c {font-family:Arial; font-size:13px; color: White; font-weight: bold; text-align: center;}');
document.writeln('.tc5_c1 {height: 35px;}');
document.writeln('.t_navigate_to1 {width: 50%; text-align:center; font-family:Arial; font-size: 13px; text-decoration: underline; }');
document.writeln('.t_navigate_to1 a {cursor: hand; cursor: pointer; color: ' + Font3 + ' }');
document.writeln('.t_navigate_to2 a {cursor: hand; cursor: pointer; color: ' + Font3 + '; }');
document.writeln('.t_navigate_to2 {width: 50%; text-align:center; font-family:Arial; font-size: 13px; text-decoration: underline; color: ' + Font3 + '; }');
document.writeln('.tmarq_cont {}');
document.writeln('.tcellText {font-size: 11px; font-family: Arial; color: Black;}');
document.writeln('.cityFrom {font-size: 11px; font-family: Arial; color: Blue;}');
document.writeln('#marqText {height: 110px !important; overflow: hidden !important; text-overflow: clip;}');
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 class="t_main" id="t_main" border=0 cellpadding=0 cellspacing=0>';
strHTML = strHTML + '<tr>';
strHTML = strHTML + '<td class="r1_c1" >';
strHTML = strHTML + '<table class="t_marquee" border=0 cellpadding=0 cellspacing=0>';
strHTML = strHTML + '<tr><td class="tm1_c1">&nbsp;</td><td class="tm1_c2">' + strMarqTitle + '</td><td class="tm1_c3">&nbsp;</td></tr>';
strHTML = strHTML + '<tr><td class="tm2_c1">&nbsp;</td><td class="tm2_c2"><script language="javascript">MarqueeText()</script></td><td class="tm2_c3">&nbsp;</td></tr>';
strHTML = strHTML + '<tr><td class="tm3_c1">&nbsp;</td><td class="tm3_c2">&nbsp;</td><td class="tm3_c3">&nbsp;</td></tr>';
strHTML = strHTML + '</table>';
strHTML = strHTML + '</td>';
strHTML = strHTML + '<td class="r1_c2" >';
strHTML = strHTML + '<table class="t_combo" border="0" cellpadding=0 cellspacing=0>';
strHTML = strHTML + '<tr><td class="tc1_c1" colspan=4>';


strHTML2 = strHTML2 + '</td></tr>';
strHTML2 = strHTML2 + '<tr><td class="adjust" rowspan="4">&nbsp;</td><td class="tc2_c1">' + strFrom + '</td><td class="tc2_c2"><script type="text/javascript">ShowTopCombo();';
strHTML2 = strHTML2 + '</script></td><td class="tc2_c3"></td></tr>';
strHTML2 = strHTML2 + '<tr><td class="tc3_c1">' + strTo + '</td><td class="tc3_c2"><script type="text/javascript">ShowBottomCombo();';
strHTML2 = strHTML2 + '</script></td><td class="tc3_c3"></td></tr>';
strHTML2 = strHTML2 + '<tr><td class="tc4_c1" colspan=3>';
strHTML2 = strHTML2 + '<center>';
strHTML2 = strHTML2 + '<table class="t_navigate" border=0 cellpadding=0 cellspacing=0><tr><td class="t_navigate_c" onclick="document.ETX.submit()"><center>';
strHTML2 = strHTML2 + strButton;
strHTML2 = strHTML2 + '</center>';
strHTML2 = strHTML2 + '</td></tr>';
strHTML2 = strHTML2 + '</table>';
strHTML2 = strHTML2 + '</center>';
strHTML2 = strHTML2 + '</td></tr>';
strHTML2 = strHTML2 + '<tr><td class="tc5_c1" colspan=3>';
strHTML2 = strHTML2 + '<center>';
strHTML2 = strHTML2 + '<table class="t_navigate2" border=0 cellpadding=0 cellspacing=0>';
strHTML2 = strHTML2 + '<tr><td class="t_navigate_to1"><a href="' + strURL + profileName + '&cnt=log" target="_blank">'
strHTML2 = strHTML2 + strLog + '</a></td><td class="t_navigate_to2"><a href="' + strURL + profileName + '&cnt=log" target="_blank">' + strChange + '</a></td></tr>';
strHTML2 = strHTML2 + '</table>';
strHTML2 = strHTML2 + '</center>';
strHTML2 = strHTML2 + '</td></tr>';
strHTML2 = strHTML2 + '</table>';
strHTML2 = strHTML2 + '</td>';
strHTML2 = strHTML2 + '<td class="r1_c3" >&nbsp;</td>';
strHTML2 = strHTML2 + '<td class="r1_c4" ></td>';
strHTML2 = strHTML2 + '</tr></table></form>';









function showTop() {
document.write(strHTML);
}    
function showBottom() {
document.write(strHTML2);
}
function showDefaults() {
document.getElementById("et_dctr").value = strDefaultFrom;
SetBottomCombo(document.getElementById("et_dctr"));
document.getElementById("et_actr").value = strDefaultTo;
}



function MarqueeText()
{
strMarqueeText = strMarqueeText + '<div id="vmarquee" style="position:relative; width: 160px; height: 120px; margin-right:1px; margin-left:5px;" class="tmarq_cont">';
strMarqueeText = strMarqueeText + '<!--YOUR SCROLL CONTENT HERE-->';
strMakeList = strMakeList + strList3;
strMakeList = strMakeList.replace(/FullLink/g, strURL + profileName + "&cnt=swr");
strMarqueeText = strMarqueeText + "<marquee id='marqText' direction='up' scrollamount=2 height='120px' onmouseover='this.setAttribute(\"scrollamount\",\"0\")' onmouseout='this.setAttribute(\"scrollamount\",\"2\")'>" + strMakeList + "</marquee>";
strMarqueeText = strMarqueeText + '<!--YOUR SCROLL CONTENT HERE-->';
strMarqueeText = strMarqueeText + '</div>';
document.writeln(strMarqueeText);
}
                
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";
    }    
}

