/**********************************************************************
	Project: Avison Young
	Version: 0.0.1
	Author: Hze
	Netgenetix Media
 *********************************************************************/




/**********************************************************************
	Popups
 *********************************************************************/
function offsite(url) {
	return openWindow(url, 'offsite', 'directories,location,menubar,resizable,scrollbars,status,toolbar');
}

function mockup(url) {
	return openWindow(url, 'offsite', 'directories,location,menubar,resizable,scrollbars,status,toolbar');
}

function contactPopup(url, target) {
	return openCenteredWindow(url, target, 480, 480, '', '', '', 'ay_opener');
}

function sapPopup() {
	return openCenteredWindow('/sap_popup.aspx', 'applyjob', 560, 500, '', '', '', 'ay_opener');
}

function applyjobPopup(job) {
	return openCenteredWindow('/applyjob_popup.aspx?job='+job, 'applyjob', 480, 480, '', '', '', 'ay_opener');
}

function propertyPopup(url) {
	return openCenteredWindow(url, 'propertyshot', 484, 504, 0, 0, 0, 'ay_opener');
}

function galleryPopup(url) {
	return openCenteredWindow(url, 'gallery', 750, 500, 0, 0, 0, 'ay_opener');
}

function emailFriendPopup(url, target) {
	return openCenteredWindow(url, target, 480, 480, '', '0', '', 'ay_opener');
}

/**********************************************************************
	FLASH
 *********************************************************************/

function flashContent(requiredFlashVersion, movieName, replacementImage, width, height) {
	if ( getFlashVersion() >= requiredFlashVersion) {
		document.write('<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + requiredFlashVersion + ',0,0,0" width="' + width + '" height="' + height + '" border="0" VIEWASTEXT>');
		document.write('<param name="movie" value="' + movieName + '" />');
		document.write('<param name="quality" value="high" />');
		document.write('<embed src="' + movieName + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed></object>');
	} else {
		document.write('<img src="' + replacementImage + '" width="' + width + '" height="' + height + '" alt="" border="0" /><br />');
	}
}




/**********************************************************************
	DROPDOWN
 *********************************************************************/

function navChange(formName, popupName, target) {
	var popup = document[formName].elements[popupName];
	if (popup.options[popup.selectedIndex].value != "") {
		window.open(popup.options[popup.selectedIndex].value, target);
		popup.selectedIndex=0;
	}
}




/**********************************************************************
	ROLLOVER
 *********************************************************************/

var propertyIMG= new Image();

function swapIMG(type) {
	img='property_img_full';
	layer = 'main-body';
	if (document.layers) {
		document.layers[layer].document.images[img].src = type.src;
	} else {
		document.images[img].src = type.src;
	}
}
