//fixes for top_container instruction text and rates calculator
if(navigator.appName == "Microsoft Internet Explorer"){
    document.getElementById('phone_container').style.marginTop = '0';
    document.getElementById('main_nav').style.marginTop = '0';
    document.getElementById('tab_home').style.display = 'inline';
    document.getElementById('tab_rates').style.display = 'inline';
    document.getElementById('tab_buycredits').style.display = 'inline';
    document.getElementById('tab_instructions').style.display = 'inline';
    document.getElementById('accessnr_bar').style.marginTop = '60px';
    document.getElementById('accessnr_bar').style.marginLeft = '216px';
    document.getElementById('price_bar').style.marginLeft = '214px';
    document.getElementById('price_bar').style.marginTop = '-95px';
    document.getElementById('rates_calculator_container').style.height = '254px';
    document.getElementById('rates_calculator_container').style.width = '443px';
    document.getElementById('phone_image').style.marginTop = '19px';
    document.getElementById('navmenulist').style.marginTop = '47px';
}


window.onresize = adjustScreen;
adjustScreen();

//fix for adjusting #bottom_container_left width & height depending on browser resolution
function adjustScreen(){

	//adjustHeight();
	var needHeight = 0;
    var browserHeight = 0;
    if(navigator.appName == "Microsoft Internet Explorer"){
        browserHeight = document.body.offsetHeight;
    }else{
        browserHeight = window.innerHeight;
    }
    needHeight = browserHeight - 456;

	$scrollbar = false;
    if(document.getElementById('main').offsetHeight < needHeight) //do only when there is no scrollbar
        document.getElementById('bottom_container').style.height = needHeight + 'px';
	else
		$scrollbar = true;
	
	//adjust width
    var needWidth = 0;
    var browserWidth = 0;
    if(navigator.appName == "Microsoft Internet Explorer"){
        browserWidth = document.body.offsetWidth;
		$scrollbar = true;
    }else{
        browserWidth = window.innerWidth;
    }
    if($scrollbar) //scrollbar is present
        needWidth = ((browserWidth - 980) - 17) / 2;
    else //no scollbar
        needWidth = (browserWidth - 980) / 2;
    if(needWidth > 0)
        document.getElementById('bottom_container_left').style.width = needWidth + 'px';
    else
        document.getElementById('bottom_container_left').style.width = '0';

    //fix for the bug when resizing screens (design got messed up)
    if(browserWidth < 980){
        document.getElementById('bottom_container').style.position = 'absolute';
        document.getElementById('top_container').style.position = 'absolute';
        document.getElementById('top_content_bg_mid').style.width = '980px';
    }else{
        document.getElementById('bottom_container').style.position = 'static';
        document.getElementById('top_container').style.position = 'static';
        document.getElementById('top_content_bg_mid').style.width = '100%';
    }
}

//called in lowcaller.com when contained in iframe on dowload pages
function doStep3(){
    document.getElementById('three').className='third_active';
	document.getElementById('two').className='second';
}
