//add www in url
	function addWWWInUrl(baseUrl){
		window.location.href = baseUrl;
	}
	
	//analysis url
/*	function analysisAddress(){
	var str= window.location.href;
	var sliceStr = window.location.href.slice(7);
		if(str.indexOf("www")==-1 && str.indexOf("file:")==-1 && str.indexOf("localhost")==-1){
			url = "http://www." + sliceStr;
			addWWWInUrl(url);
		}
	}
	
	analysisAddress();*/

	//-----------settings-----------------------------------------start
	var siteName = "Media Kinetics";
	var swfFileName = "content/main.swf"
	var flashvars = {};
	//flashvars.varName = "varValue";
	var swfWidth = 1000;
	var swfHeight = 550;
	var bgColor = "#333333";
	var flashVersion = "9";
	var googleAnalyticsAccountNumber = "";
	//-----------settings-----------------------------------------e-n-d

	var viewportwidth;
	var viewportheight;
	//-----------change title

	window.onload = function() {
		document.title = siteName;
	}

	//-----------swfobject

	var params = {};
	params.bgcolor = bgColor;
	params.menu = "true";
	//params.quality = "autohigh";
	params.scale = "noscale";
	params.wmode = "window";
	params.swliveconnect = "true";
	params.allowfullscreen = "true";
	params.allowscriptaccess = "always";
	params.allownetworking = "all";
	params.base = "content";
	var attributes = {};
	attributes.id = "FlashContent";
	attributes.name = "FlashContent";
	swfobject.embedSWF(swfFileName, "FlashContent", "100%", "100%",
			flashVersion, "content/javascript/expressInstall.swf", flashvars, params,
			attributes);

	//-----------swffit

	swffit.fit("FlashContent", swfWidth, swfHeight);

	swfmacmousewheel.registerObject(attributes.id);
	
	function getFlashPlayerRequirement() {
		return flashVersion;
	}

	var intervalID;
	function resizeFit() {
		resizeW = swfWidth;
		resizeH = swfHeight;
		intervalID = window.setInterval("resizing()", 1);
	}

	var resizeW = 100, resizeH = 80;
	function resizing() {
		if (inWidth < swfWidth) {
			resizeW += 20;

		}
		if (inHeight < swfHeight) {
			resizeH += 20;
		}
		if (inWidth < swfWidth || inHeight < swfHeight) {
			self.resizeTo(resizeW, resizeH);
		} else {
			self.resizeTo(resizeW + 60, resizeH + 100);
			self.moveTo((screen.availWidth - resizeW - 60) / 2,
					(screen.availHeight - resizeH - 100) / 2);
			clearInterval(intervalID);
			//alert("resize to Flash Size:" + inWidth + "x" + inHeight);
		}
		getViewportSize();
	}

	function resizeFull() {
		//alert("resizeFull");
		self.moveTo(0, 0);
		self.resizeTo(screen.availWidth, screen.availHeight);
	}

	function resizeWindow(w, h) {
		self.moveTo((screen.availWidth - w) / 2, (screen.availHeight - h) / 2);
		self.resizeTo(w, h);
	}

	//-----------2.get swf size
	function getSwfSize() {
		flashsize = [ swfWidth, swfHeight ]
		return flashsize;
	}
	//-----------3.get viewport size
	var inWidth = 0, inHeight = 0;
	getViewportSize();
	function getViewportSize() {
		if (typeof (window.innerWidth) == 'number') {
			//Non-IE
			inWidth = window.innerWidth;
			inHeight = window.innerHeight;
			outWidth = window.outerWidth;
			outHeight = window.outerHeight;
		} else if (document.documentElement
				&& (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
			//IE 6+ in 'standards compliant mode'
			inWidth = document.documentElement.clientWidth;
			inHeight = document.documentElement.clientHeight;
			outWidth = window.outerWidth;
			outHeight = window.outerHeight;
		} else if (document.body
				&& (document.body.clientWidth || document.body.clientHeight)) {
			//IE 4 compatible
			inWidth = document.body.clientWidth;
			inHeight = document.body.clientHeight;
		}
		//alert("browser size" + inWidth + "x" + inHeight);

		viewportSize = [ inWidth, inHeight ];
		return viewportSize;
	}
