// Button Änderung auf Order.tpl
function submitForm(s) {
s.value = "... wird gespeichert";
return true;
}

// Tabs für Detailseite
$(document).ready(function() {

        //When page loads...
        $(".tab_content").hide(); //Hide all content
        $("ul.tabs li:first").addClass("active").show(); //Activate first tab
        $(".tab_content:first").show(); //Show first tab content

        //On Click Event
        $("ul.tabs li").click(function() {

                $("ul.tabs li").removeClass("active"); //Remove any "active" class
                $(this).addClass("active"); //Add "active" class to selected tab
                $(".tab_content").hide(); //Hide all tab content

                var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
                $(activeTab).fadeIn(); //Fade in the active ID content
                return false;
        });

        $("ul.rattabs li").click(function() {

                $("ul.tabs li").removeClass("active"); //Remove any "active" class
                $(this).addClass("active"); //Add "active" class to selected tab
                $(".tab_content").hide(); //Hide all tab content

                var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
                $(activeTab).fadeIn(); //Fade in the active ID content
                return false;
        });

});

// Anzeige von mehr Bewertungen toogle-Effekt
$(document).ready(function() {
 // hides the slickbox as soon as the DOM is ready
 // (a little sooner than page load)
  $('#slickbox').hide();
 // shows the slickbox on clicking the noted link
  $('a#slick-show').click(function() {
 $('#slickbox').show('slow');
 return false;
  });
 // hides the slickbox on clicking the noted link
  $('a#slick-hide').click(function() {
 $('#slickbox').hide('fast');
 return false;
  });
 // toggles the slickbox on clicking the noted link
  $('a#slick-toggle').click(function() {
 $('#slickbox').toggle(400);
 return false;
  });
});

// Tabs für Detailseite - Cross-Selling
$(document).ready(function() {

        //When page loads...
        $(".tab_content2").hide(); //Hide all content
        $("ul.tabs2 li:first").addClass("active").show(); //Activate first tab
        $(".tab_content2:first").show(); //Show first tab content

        //On Click Event
        $("ul.tabs2 li").click(function() {

                $("ul.tabs2 li").removeClass("active"); //Remove any "active" class
                $(this).addClass("active"); //Add "active" class to selected tab
                $(".tab_content2").hide(); //Hide all tab content

                var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
                $(activeTab).fadeIn(); //Fade in the active ID content
                return false;
        });

        $("ul.rattabs li").click(function() {

                $("ul.tabs2 li").removeClass("active"); //Remove any "active" class
                $(this).addClass("active"); //Add "active" class to selected tab
                $(".tab_content2").hide(); //Hide all tab content

                var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
                $(activeTab).fadeIn(); //Fade in the active ID content
                return false;
        });

});

 //Firma und UST-ID Felder ausblenden in user.tpl
function ReloadAdress(){
if( document.order.oxaddressid.value != -1){
document.order.fnc.value    = "";
document.order.cl.value     = "user";
document.order.submit();}
// clearing fields
else{oRoot = document.order.elements;
// default inputs
aFields = new Array("deladr[oxaddress__oxfname]","deladr[oxaddress__oxlname]","deladr[oxaddress__oxcompany]",
"deladr[oxaddress__oxstreet]","deladr[oxaddress__oxstreetnr]","deladr[oxaddress__oxzip]","deladr[oxaddress__oxcity]",
"deladr[oxaddress__oxaddinfo]","deladr[oxaddress__oxfon]","deladr[oxaddress__oxfax]");
for (i=0;i<aFields.length;i++){   if ( oRoot.namedItem(aFields[i]) != null)
oRoot.namedItem(aFields[i]).value = "";}
// select lists
aFields = new Array("deladr[oxaddress__oxcountryid]","deladr[oxaddress__oxsal]");
for (i=0;i<aFields.length;i++){if ( oRoot.namedItem(aFields[i]) != null )
oRoot.namedItem(aFields[i]).options.item(0).selected = true;}}}

function select_sal( val)
{
obj = document.getElementById( 'company');
if ( obj){if ( val){obj.style.visibility = "";}
else{obj.style.visibility = "hidden";}
}check_country();}

function check_country()
{
obj = document.getElementById( 'country_id');if ( obj){
if ( obj.value != 'a7c40f631fc920687.20179984'){obj = document.getElementById( 'company');
if ( obj && obj.style.visibility == ""){obj = document.getElementById( 'ustid');
if ( obj){obj.style.display = '';return;}}}}obj = document.getElementById( 'ustid');
if ( obj){obj.style.display = 'none';}
}

function packstation ()
{
   if(document.order.chkpack.checked == true)
                                        {
                                                document.order.packnr.value = 'Packstationsnummer: ';
                                                document.order.postnr.value = 'PostNummer:';
                                                document.order.packstr.value = 'Packstation';
                                                document.order.countryoption.style.display = 'none';
                                                document.order.countryoption.disabled = true;
                                                document.order.countryoption.value = 'Deutschland';
                                                document.order.optvalue.style.display = 'inline';
                                                document.order.optvalue.value = 'Deutschland';
                                                document.order.optvalue.disabled = false;
                                                document.order.hiddencountry.style.display = 'inline';
                                                document.order.hiddencountry.disabled = false;
                                        }

                                else
                                        {
                                                document.order.packnr.value = 'Strasse, Hausnummer:';
                                                document.order.postnr.value = 'Firma:';
                                                document.order.packstr.value = '';
                                                document.order.countryoption.style.display = 'inline';
                                                document.order.countryoption.disabled = false;
                                                document.order.optvalue.style.display = 'none';
                                                document.order.optvalue.disabled = true;
                                                document.order.hiddencountry.style.display = 'none';
                                                document.order.hiddencountry.disabled = true;
                                        }
}

function showHide(divID, imgID){
        if (document.getElementById(divID).style.display == "none") {
                document.getElementById(divID).style.display = "block";
                document.getElementById(imgID).src = "Images/upArrow.gif";
        } else {
                document.getElementById(divID).style.display = "none";
                document.getElementById(imgID).src = "Images/dnArrow.gif";
        }
}

// Einstellungen für Fontreplace mit Classen
$(document).ready(function(){
  $('.start_h2_pink').fontReplace({fontFile: 'blueprin',fontSize: '14',fontColor:'B81270',width:'250',height:'10'});
  $('.start_h2_green').fontReplace({fontFile: 'blueprin',fontSize: '14',fontColor:'4E7304',width:'250',height:'10'});
  $('.h2_title').fontReplace({fontFile: 'blueprin',fontSize: '20',fontColor:'B81270',width:'250'});
  $('.h2_news').fontReplace({fontFile: 'blueprin',fontSize: '16',fontColor:'4E7304',width:'250'});
  $('.h2_box').fontReplace({fontFile: 'blueprin',fontSize: '16',fontColor:'4E7304',width:'350'});
  $('.testen').fontReplace({fontFile: 'blueprin',fontSize: '12',fontColor:'4E7304',width:'350'});
});