//writes the html to load the flash content
function writeFlash() {

	document.writeln("<object class=\"flashPlyr\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"701\" height=\"436\">");
	document.writeln("<param name=\"movie\" value=\"acquier1.swf\">");
	document.writeln("<param name=\"loop\" value=\"false\">");
	document.writeln("<param name=\"menu\" value=\"false\">");
	document.writeln("<param name=\"quality\" value=\"high\">");
	document.writeln("<param name=\"bgcolor\" value=\"#FFFFFF\">");
	document.writeln("<embed class=\"flashPlyr\" src=\"acquier1.swf\" width=\"701\" height=\"436\" loop=\"false\" menu=\"false\" quality=\"high\" bgcolor=\"#FFFFFF\"  type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
	document.writeln("</object>");
	
}

var picWin; 		//ref to the picture popup window
var popWidth; 		//ref to width of the existing popup window

function openPicWin(object){

	switch (object) {
		case "Mirror":
			openWindow("mirror.html",500,433);
			break;
		case "Carpet":
			openWindow("morris.html",540,433);			
			break;			
		case "Choc_Pot":
			openWindow("pot.html",500,433);		
			break;			
		case "Clock":
			openWindow("clock.html",560,433);		
			break;			
		case "Chinese":
			openWindow("jar.html",560,433);			
			break;			
		case "Bookcase":
			openWindow("bookcase.html",540,433);				
			break;			
		case "Pendant":
			openWindow("pendant.html",500,433);			
			break;			
		case "Vase":
			openWindow("lalique.html",560,433);			
			break;			
		case "Chair":
			openWindow("lutyens.html",560,433);			
			break;			
		default:
			//do nothing
		break;
	}
	
}

function openWindow(file, width, height){

	var url = "../picwin/" + file;

	if (!this.picWin || this.picWin.closed){
		var features = "width=" + width + ",height=" + height + ",resizable=no,scrollbars=no"; 
		picWin = window.open(url,"picWin",features);
	} else {
		var dw = width - popWidth;
		picWin.resizeBy(dw, 0);
		picWin.location = url;
		picWin.focus();
	}
	popWidth = width;
	
}

function getWindowHeight(){
	
	var h;
	if(window.innerHeight){
		h = window.innerHeight;
	} else if(document.body.offsetHeight){
		h = document.body.offsetHeight;
	} else {
		h = 500;
	}

	return h;

}

function positionLayout(contentWrapperId, footerId, contentHeight){

	var wHeight = getWindowHeight();
	var boxMargin = Math.max((wHeight-contentHeight)/2,0);

	if(document.getElementById){

		document.getElementById(contentWrapperId).style.marginTop = boxMargin + "px";
		document.getElementById(footerId).style.marginTop = boxMargin + "px";
	} else if(document.all){
		document.all[contentWrapperId].style.marginTop = boxMargin + "px";
		document.all[footerId].style.marginTop = boxMargin + "px";
	}	
}


function setExitPage(){

	if(window.opener){
		if(window.opener.location != "../thanks.html"){
			window.opener.location.replace("../thanks.html");
		}
	}
}

function openFullWindow(url) {
	w = screen.availWidth - 10;
	h = screen.availHeight - 118;
	winName = 'acquier';
	features = 'width='+w+',height='+h+',scrollbars=no,menubar=yes,toolbar=yes,resizable=yes,left=0,top=0';
	win = window.open(url,winName,features);
	if(!win) window.location = url;
	return false;
}
