//alert("FaceInstitute.js is loaded");
function doVisPop(){
	pleasePopUp("http://faceinstitute.ca/popup.html",900,760);
}

function doVisPopFR(){
	pleasePopUp("http://institutvisage.ca/popup_fr.html",900,760);
}

function pleasePopUp(theAddress,theWidth,theHeight){
	if(!theWidth){ theWidth = 500; }
	if(!theHeight){ theHeight = 500; }
	window.open(theAddress,'_blank','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width='+theWidth+',height='+theHeight+',left=50,top=50,titlebar=yes');
	
}

function docBack(){
	var myFlashMovie = document.getElementById("FaceInstitute");
	myFlashMovie.doctorLocator_externalCall();
}

function musicBack(videoIsPlaying){
	var myFlashMovie = document.getElementById("FaceInstitute");
	if(videoIsPlaying){
		myFlashMovie.music_externalPlay(false);
	} else {
		myFlashMovie.music_externalPlay(true);
	}
}

function sizeControl(){
	//alert("sizeControl()");
	setInterval('minSizeControl(900,570);', 400);
}

function minSizeControl(theW,theH){
	var width;
	var height;
	if(document.layers) {
		width = window.innerWidth;
		height = window.innerHeight;
	} else {
		width = document.body.clientWidth;
		height = document.body.clientHeight;
	}
	//	alert("detected: "+width+" x "+height+"\n"+theW+" x "+theH+"\n"+( width < theW )+" x "+( height < theH ));
	if(width < theW){
		//alert("width issues");
		//setTimeout("resizeOuterBy("+(theW-width)+",0);",10);
		resizeOuterBy((theW-width),0);
	} 
	if (height < theH){
		//alert("height issues");
		//setTimeout("resizeOuterBy(0,"+(theH-height)+");",10);
		resizeOuterBy(0,(theH-height+30));
	}


}

function resizeOuterBy(w,h) {
	//alert("resizeOuterBy("+w+","+h+")");
	try{
		top.resizeBy(w,h);
	}catch(ex){}
}
