/* Developed by EverMedia

COLOUR FUTURES 2009
ALBA - Tendencias de Colores 2009

*/



/*DETECTA PLUGIN DO FLASH */

/* START: GLOBAL VARS */

var flashDir = "/webapp/wcs/stores/EUKDLX/flash/";

/* Default Flash version supported,

Flash Write function can override this if passed a different version as the last argument*/

var flash_ver = 7;



function fDetect() {
	/* detect which version of Flash installed, either  */

	fPlug= (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if (fPlug) {
		fPlug = parseInt(fPlug.description.substring(fPlug.description.indexOf(".")-2));
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && navigator.userAgent.indexOf("Windows")>=0 ) {
		
		document.writeln('<script language="vbscript" type="text/vbscript">');
		document.writeln('on error resume next');
		document.writeln('fPlug = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+flash_ver+'")))');
		document.writeln('</script>');
		if (fPlug>0) {fPlug=flash_ver;}
	}
		
	if (fPlug<flash_ver) {
		document.location.href = "/internas/detect_plugin.shtm"
	}

}
fDetect();




// escreve flash width height

function flash_wh (url, width, height) {

	document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + flash_ver + '" width="' + width + '" height="' + height + '" style="float:left">');

	document.writeln('<param name="movie" value="' + url + '"/>');

	document.writeln('<param name="quality" value="high" /> ');

	document.writeln('<embed src="' + url + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');

	document.writeln('</object>');

	}




// CENTRALIZA POPUP

function abrir(pagina,largura,altura) {


w = screen.width;
h = screen.height;


meio_w = w/2;
meio_h = h/2;


altura2 = altura/2;
largura2 = largura/2;
meio1 = meio_h-altura2;
meio2 = meio_w-largura2;



// função de abrir popup centralizado	
	window.open(pagina,'','height=' + altura + ', width=' + largura + ', top='+meio1+', left='+meio2+'');

}



// função de abrir popup 

function abrePopup(largura,altura,url,scrollbar){

	window.open(url,"Popup","scrollbars="+scrollbar+",width="+largura+",height="+altura+"")

}

