﻿var selectedMenu;
var movieCollection = new Array("animinterior1","animinterior2","animinterior3","animinterior4");


function lateralAnim(){
	var mv = movieCollection[Math.floor(Math.random()*movieCollection.length)];
	interiorAnim(mv)
}

function onMenuOver(obj){
	if(selectedMenu == obj){return;}
	obj.src = "/images/menu/menu_"+obj.id+"_on.png";
}

function onMenuOut(obj){
	if(selectedMenu == obj){return;}
	obj.src = "/images/menu/menu_"+obj.id+"_off.png";
}

function selectMenu(objId){
	var slct = document.getElementById(objId);
	slct.src = "/images/menu/menu_"+slct.id+"_selected.png";
	selectedMenu = slct;
}


function logoAnim(){
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
		'width', '288',
		'height', '137',
		'src', '/flash/logoAnim',
		'quality', 'high',
		'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
		'align', 'middle',
		'play', 'true',
		'loop', 'false',
		'scale', 'showall',
		'wmode', 'transparent',
		'devicefont', 'false',
		'id', 'logo',
		'name', 'logo',
		'menu', 'false',
		'allowFullScreen', 'false',
		'allowScriptAccess','sameDomain',
		'movie', '/flash/logoAnim',
		'salign', ''
		); //end AC code
	}	
}


function interiorAnim(movieToload){
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '345',
			'height', '416',
			'src', '/flash/'+movieToload,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'interior',
			'name', 'interior',
			'menu', 'false',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', '/flash/'+movieToload,
			'salign', ''
			); //end AC code
	}	
}

function homeAnim(){
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '522',
			'height', '626',
			'src', '/flash/homeAnim',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'xmlPhraser',
			'name', 'xmlPhraser',
			'menu', 'false',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', '/flash/homeAnim',
			'salign', ''
			); //end AC code
	}	
}


function calendarioModalfa(){
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '522',
			'height', '465',
			'src', '/flash/calendario',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'xmlPhraser',
			'name', 'xmlPhraser',
			'menu', 'false',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', '/flash/calendario',
			'salign', ''
			); //end AC code
	}
}


function clippingListagem(xmlPath){
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '1',
			'height', '1',
			'src', '/flash/xmlPhraser',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'xmlPhraser',
			'bgcolor', '#ffffff',
			'name', 'xmlPhraser',
			'menu', 'false',
			'FlashVars','xmlPath='+xmlPath,
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', '/flash/xmlPhraser',
			'salign', ''
			); //end AC code
	}
}


function homeVideoComponent(){
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '383',
			'height', '298',
			'src', '/flash/galeriaFilmes',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'homeComponent',
			'bgcolor', '#ffffff',
			'name', 'homeComponent',
			'menu', 'false',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', '/flash/galeriaFilmes',
			'salign', ''
			); //end AC code
	}
}

function reloadClipping(xmlPath){
	document["xmlPhraser"].reloadClipping(xmlPath);
}


function shareCandidato(imgPath, nome, cidade){
	                
	    var attachment = {
					  'name' : ''+nome+' de '+cidade+' candidatou-se ao Modalfa Fashion Dream 2010',
					  'href' : 'http://www.modalfafashiondream.com/candidatos/',
					  'caption' : 'Fica a conhecer todos os candidatos e calendário de eventos em www.modalfafashiondream.com!',
					  'media' : [{'type' : 'image', 'src' : 'http://www.modalfafashiondream.com'+imgPath, 'href' : 'http://www.modalfafashiondream.com/'}] //A imagem tem de estar online!
					  };
		var action_links = [{'text' : 'Candidatos Modalfa Fashion Dream','href' : 'http://www.modalfafashiondream.com/candidatos/'}];                         
		//FB.Connect.streamPublish('', attachment, action_links, pageId, 'Partilha o seu bigode com todos os fãs do movimento!', null);
		 FB.ui(
		   {
		     method: 'stream.publish',
		     attachment: attachment,
		     action_links: action_links,
		     user_prompt_message: 'Publique a sua fotografia e ganhe convites familiares para Jardim Zoológico!'
		   },
		   function(response) {
		     if (response && response.post_id) {
		       //alert('Post was published.');
		     } else {
		       //alert('Post was not published.');
		     }
		   }
		 );
		 
	}
	/* FACEBOOK FCTS */