function getCurrentURL(){
	return window.location.href;
}
function getBaseURL(){
	//alert("getBaseURL:" + window.location.href);
	var out = "";
	if ( window.location.href.indexOf("http://karamann.com/")  >  -1) out = "http://www.karamann.com/";
	if ( window.location.href.indexOf("http://test.karamann.com/") > -1) out = "http://test.karamann.com/";
	return out;
	
}

var mousewheel;
function writeFlashTags( branch, internalOrExternal, rootPage ) 
{
	var swfSrc = "mainShell.swf";
	var baseURL = getBaseURL();
	if (window.location.href.indexOf("ShowroomDisplay.aspx") > -1){
		//baseURL = "http://test.karamann.com/";
	}
	swfSrc = baseURL + swfSrc;
	//alert("swfSrc:"+swfSrc);
	if (internalOrExternal){
	}else{
		internalOrExternal = "external";
	}
	if (rootPage){
	}else{
		rootPage = "index.html";
	}
	
	var params = {
		quality: "high",
		scale: "noscale",
		wmode: "window",
		allowScriptAccess: "always",
		bgcolor: "#000000",
		allowNetworking: "all",
		SeamlessTabbing: "false",
		base:baseURL
	};
	var flashvars = {serviceLocation:internalOrExternal, rootPage:rootPage};
	if (branch != ""){
		flashvars.branch = branch;
	}
	//alert("flashvars.serviceLocation :" + flashvars.serviceLocation + " rootpage:" + flashvars.rootPage);
	var attributes = {id:"flashcontent"};
	swfobject.embedSWF( swfSrc, "flashcontent", "100%", "100%", "9.0.45", "expressInstall.swf", flashvars, params, attributes);
	//swffit.fit("flashcontent",1000,600);

	mousewheel = new SWFMouseWheelExternal("flashcontent");
	changeRule( 'body', 'height', '100%' );
	changeRule( 'body', 'width', '100%' );
	changeRule( 'body', 'overflow', 'hidden' );
	changeRule( 'body', 'overflow-x', 'hidden' );
	changeRule( 'body', 'overflow-y', 'hidden' );
	changeRule( 'html', 'height', '100%' );
	changeRule( 'html', 'width', '100%' );
	changeRule( 'html', 'overflow', 'hidden' );
	changeRule( 'html', 'overflow-x', 'hidden' );
	changeRule( 'html', 'overflow-y', 'hidden' );
}

function changeRule(divID, prop, value) {
	var theRules = new Array();
	var divHolder = 	document.getElementById(divID);
	//alert("divHolder:"+divHolder + " divId:" + divID)
	if (divHolder){
		divHolder.style[prop] = value
	}
}
