
function floatFlash(src, width, height, swfPosition){
	
	
	var ie4 = (document.all);
	var ns4 = (document.layers);
	var ns6 = (!document.all && document.getElementById);
	
	if (ie4) {
	var horiCenter = document.body.clientWidth/2
	var vertCenter = document.body.clientHeight/2
	}
	else {
	var horiCenter = window.innerWidth/2
	var vertCenter = window.innerHeight/2
	}
	
	var horiPos = horiCenter - width/2
	var vertPos = vertCenter - height/2
	
	
	var setLocation = new Array();
		setLocation['TL'] = "top: 0; left: 0;";
		setLocation['TR'] = "top: 0; right: 0;";
		setLocation['BL'] = "bottom: 0; left: 0;";
		setLocation['BR'] = "bottom: 0; right: 0;";
		setLocation['C'] = "top: "+vertPos+"; left: "+horiPos+";";
		setLocation['BC'] = "bottom: 0; left: "+horiPos+";";
	// Set center
	var center = true;
	document.write ('<div style="position: absolute; ' + setLocation[swfPosition] +  '" z-index: 100;>');
	
	loadFlashObject(src, width, height, 0);
	document.write('</div>');
	
	
}

//scripted by W5 Internet - my Virtual Sales Person
//remove requirement for ie users to click on obj before using.

function loadFlashObject(src, width, height, loop){
	htmlStr = '<object name="' +src+ '" ';
	htmlStr += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0" ';
	htmlStr += 'width="' + width + '" height="' + height + '"';
	htmlStr += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"><param name="loop" value="0" />';
	htmlStr += '<param name="movie" value="' + src + '" /><param name="wmode" value="transparent" />';
	htmlStr += '<param name="quality" value="high" />';
	htmlStr += '<embed width="' + width + '" height="' + height + '" src="' + src + '" quality="high"wmode="transparent" ';
	htmlStr += 'pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash" ></embed></object>';
	document.write(htmlStr);
	
	var movieName = src;
	
	  if(navigator.appName.indexOf("Microsoft Internet")==-1){
		if(document.embeds && document.embeds[movieName]){
		 	 document.embeds[movieName].play(); 
		}
	  }
}

//floatFlash('sample.swf', 640, 480, 'BL');
//floatFlash('sample.swf', 640, 480, 'TL');
//floatFlash('sample.swf', 640, 480, 'TR');
//floatFlash('sample.swf', 640, 480, 'BL');
//floatFlash('sample.swf', 640, 480, 'BR');

//if the visitor came from an earlier DiamondsnDeals page, do not show the VSP again:
var camefrom = document.referrer;
//format the string to fit the IF statement:
camefrom = camefrom.toLowerCase();

if (camefrom.indexOf("www.wonderjewelers.com") == -1)
{
	//if the browser is not Firefox (problem with 2.0.0.8)
	if (!( navigator.userAgent.indexOf( 'Gecko' ) != -1 && !(navigator.userAgent.indexOf( 'Safari' ) != -1) && !(navigator.userAgent.indexOf( 'Konqueror' ) != -1)))
	{
		floatFlash('http://www.mvsp.biz/wonder/mvsp1.swf', 500, 375, 'BC');
	}
}
