/**
 *
 * BMW Korea Script Library
 * Copyright (c) 2005 interone worldwide
 *
 * @ignore
 *
 * This script contains all global javascript functions needed for running the BMW Website
 *
 * @usage   see individual function descriptions
 *
 * @author  Werner Rauch, Roland Aust
 * @edit Marcello di Simone
 * @version  2.0
 */

userbandwidth = getCookieValue("userbandwidth");
bandwidth = getCookieValue("bandwidth");

if (query.bandwidth) {
  if (query.bandwidth == "vhigh") {
  
  	detectedBandwidth = "vhigh";
  }
} 
else if (userbandwidth) {

  detectedBandwidth = userbandwidth;
} 
else if (bandwidth) {

  detectedBandwidth = bandwidth;
}


if (detectedBandwidth == "vhigh") {
  
}
else {

    setCookie("userbandwidth", "vhigh", "Sun, 31-Dec-2100 00:00:00 GMT", "/");
    self.location.reload();
}



var oldCheckWindowSize = checkWindowSize;
checkWindowSize = function(){
	oldCheckWindowSize();
	if(window.$ && window.jQuery && $("#outerDiv").length > 0){
		$(document.body).css("overflow","hidden");
		$("#outerDiv").css("overflow","auto");
		
		var currentWidth =  $(window).width(); 
		var currentHeight = $(window).height();
		
		$("#outerDiv").css("position","relative");

		$("#outerDiv").css("width","100%");
		if (currentHeight != null){
			$("#outerDiv").css("height",currentHeight - 27);
		}
		
		if(currentWidth < 980 && currentWidth > 800){
			$("#metaNavigationInline").css("width",currentWidth);
		}else if(currentWidth <= 800){
			$("#metaNavigationInline").css("width",800);
		}else{
			$("#metaNavigationInline").css("width",982);
		}

	}

}
function trackRelative(){return true;} /*bug fixing for kr /kr/en/owners/service/aftersales.html 20110826*/
