/**
 * SEE3D JAVASCRIPT FILE FOR ABERYSTWYTH UNIVERSITY ADMISSIONS WEBSITE
 * -------------------------------------------------------------------
 * Author: Harry Strange
 * E-mail: harry@see3d.co.uk
 * Year: 2008
 */


/**
 * widthChanged is called whenever the browser window is resized.  This enables us 
 * to resize the interactive map flash component, making it available in 800x600
 * and 1024x768+ resolutions.
 *
 * The component argument is the name of the flash component to be resized
 */
function widthChanged(component) {
	var flash;
	var div;
	
	var THRESHOLD_WIDTH = 900;

	// We deal with things differently if we're in IE or FF
	if(navigator.appName.indexOf("Microsoft") != -1) {
		flash = window[component];
		div = window["campusMap"]; 
	} else {
		flash = document.getElementById(component);
		div = document.getElementById("campusMap");
	}
	
    // get browser width
    var win_width = document.documentElement.clientWidth

	// Small resolutions
	if (win_width < THRESHOLD_WIDTH) {
		// 800 x 600
    	flash.setAttribute("width", "384");
		flash.setAttribute("height", "216");
		div.style.width = "384px";
		div.style.height = "216px";
		
		// Tell the flash component that we're using a small resolution, so 
		// change the text size
		thisMovie("iMap").setSize("small");
     } else if (win_width >= THRESHOLD_WIDTH) {
		 // 1024 x 768
         flash.setAttribute("width", "576");
		 flash.setAttribute("height", "324");
		 div.style.width = "576px";
		 div.style.height = "324px";
		 
		 // Revert back to a normal text size
		 thisMovie("iMap").setSize("normal");
     }
}


/**
 * Functions used to change the videos on the flash media player......
 */
function sendEvent(swf,typ,prm) { 
  thisMovie(swf).sendEvent(typ,prm); 
};

function getUpdate(typ,pr1,pr2,swf) {};

function thisMovie(swf) {
  if(navigator.appName.indexOf("Microsoft") != -1) {
    return window[swf];
  } else {
    return document[swf];
  }
};

function loadFile(swf,obj) {
  thisMovie(swf).loadFile(obj); 
};     

function init_vtour_feature_resizing()
{
}

