


var winWidth = 1024;
var checkChange;
function getWidth()
{

    /*** addthis initial integration ***/
    var divGlobalContentPadder = document.getElementById('global_content_padder');
    var divAddThis = document.getElementById('addthis');   
    if (!divAddThis) {divGlobalContentPadder.style.paddingBottom = '1.25em';}

    /*** start change width for select boxes content homepage if JS activated - onload ***/
    var selUser = document.getElementById('sel_user_pages');
    var selDoctors = document.getElementById('sel_doctor_pages');
    var selCustomers = document.getElementById('sel_customer_pages');   
    if (selUser) {selUser.style.width = '100%';}
    if (selDoctors) {selDoctors.style.width = '100%';}
    if (selCustomers) {selCustomers.style.width = '100%';}
    /*** end change width for select boxes content homepage if JS activated - onload ***/

    if ( (document.cookie.indexOf('style=1')==-1) && (document.cookie.indexOf('style=0')==-1) ) 
    {
        
        if(window.innerWidth)
        {
            winWidth = window.innerWidth;
            
            
        }
        else if (document.body && document.body.offsetWidth)
        {
            winWidth = document.documentElement.offsetWidth;
            
        }
        
        if(checkChange != winWidth){
        
            //alert(checkChange + " " + winWidth);
    
            if(winWidth < 965) 
            {
                document.getElementById("styleToSwitch").setAttribute("href", "/cps/rde/xchg/SID-E063B477-B410C7C6/ob_se_sv/hs.xsl/switch.css");
            }
            else
            {
                document.getElementById("styleToSwitch").setAttribute("href", "/cps/rde/xchg/SID-E063B477-B410C7C6/ob_se_sv/hs.xsl/empty.css");
            }
            
            checkChange = winWidth;
        }    
            
    }
}
window.onresize = getWidth;


//alert("STYLE (schmale) 1:"+document.cookie.indexOf('style=1')+" - "+"STYLE (breit) 0:"+document.cookie.indexOf('style=0'));
function openWindow(target)
{
  window.open(target,"titel", "width=800,height=600,location=no,menubar=no,resizable=yes,status=yes,toolbar=no,scrollbars=no,top="+((screen.height-600)/2)+",left="+((screen.width-800)/2));
  self.focus;
}
function openWindowScroll(target)
{
  window.open(target,"titel", "width=800,height=600,location=no,menubar=no,resizable=yes,status=yes,toolbar=no,scrollbars=yes,top="+((screen.height-600)/2)+",left="+((screen.width-800)/2));
  self.focus;
}
 
function redirect(url)  
{
    var checkExtern = url.search(/^https?:\/\//);
    if (checkExtern != -1)
    {
        window.open(url, "NewWindow");
    }
    else
    {
        window.location.href=url;
    }
}
 
/**** google chrome/webkit workaround for linked expanding teasers  ****/
(function(){
    if(Browser.Engine.name == 'trident'){return;}
    if(window.location.hash != ''){
        window.addEvent('load', function(){
                var gotohash = window.location.hash.replace('#', ''),
                    scrollel = $(document.body).getElement('#'+gotohash+', a[name="'+gotohash+'"]'),
                    wrapper = $('wrapper');
                if(!scrollel||!wrapper){return;}
                wrapper.scrollTo(0,0);
                $(document.body).scrollTo(0, $(scrollel).getPosition($(document.body)).y);
        });
    }
}())

