// vars
var	ext = '.jpg';
var baseDir = 'img/portfolio/';
var mFArray = new Array('MF_1', 'MF_2','MF_3','MF_4','MF_5','MF_6','MF_7','MF_8','MF_9','MF_10','MF_11');
var sFArray = new Array('SF_1', 'SF_2','SF_3','SF_4','SF_5','SF_6','SF_7','SF_8','SF_9','SF_10','SF_11');
var hPArray = new Array('HP_1', 'HP_2','HP_3','HP_4','HP_5','HP_6','HP_7','HP_8','HP_9','HP_10','HP_11');
var cHArray = new Array('CH_1', 'CH_2','CH_3','CH_4','CH_5','CH_6','CH_7','CH_8','CH_9','CH_10','CH_11');
var cIArray = new Array('CI_1', 'CI_2','CI_3','CI_4','CI_5','CI_6','CI_7','CI_8','CI_9','CI_10','CI_11');

//onload set listeners
Event.observe(window,'load',function(){
  //multi
	Event.observe('MF_1', 'mouseover', function(){setMFPic('MF_1');});
  Event.observe('MF_2', 'mouseover', function(){setMFPic('MF_2');});
	Event.observe('MF_3', 'mouseover', function(){setMFPic('MF_3');});
	Event.observe('MF_4', 'mouseover', function(){setMFPic('MF_4');});
  Event.observe('MF_5', 'mouseover', function(){setMFPic('MF_5');});
  Event.observe('MF_6', 'mouseover', function(){setMFPic('MF_6');});
	Event.observe('MF_7', 'mouseover', function(){setMFPic('MF_7');});
	Event.observe('MF_8', 'mouseover', function(){setMFPic('MF_8');});
  Event.observe('MF_9', 'mouseover', function(){setMFPic('MF_9');});
  Event.observe('MF_10', 'mouseover', function(){setMFPic('MF_10');});
	Event.observe('MF_11', 'mouseover', function(){setMFPic('MF_11');});

	//single
	Event.observe('SF_1', 'mouseover', function(){setSFPic('SF_1');});
  Event.observe('SF_2', 'mouseover', function(){setSFPic('SF_2');});
	Event.observe('SF_3', 'mouseover', function(){setSFPic('SF_3');});
	Event.observe('SF_4', 'mouseover', function(){setSFPic('SF_4');});
  Event.observe('SF_5', 'mouseover', function(){setSFPic('SF_5');});
  Event.observe('SF_6', 'mouseover', function(){setSFPic('SF_6');});
	Event.observe('SF_7', 'mouseover', function(){setSFPic('SF_7');});
	Event.observe('SF_8', 'mouseover', function(){setSFPic('SF_8');});
  Event.observe('SF_9', 'mouseover', function(){setSFPic('SF_9');});
  Event.observe('SF_10', 'mouseover', function(){setSFPic('SF_10');});
	Event.observe('SF_11', 'mouseover', function(){setSFPic('SF_11');});

	//historic
	Event.observe('HP_1', 'mouseover', function(){setHPPic('HP_1');});
  Event.observe('HP_2', 'mouseover', function(){setHPPic('HP_2');});
	Event.observe('HP_3', 'mouseover', function(){setHPPic('HP_3');});
	Event.observe('HP_4', 'mouseover', function(){setHPPic('HP_4');});
  Event.observe('HP_5', 'mouseover', function(){setHPPic('HP_5');});
  Event.observe('HP_6', 'mouseover', function(){setHPPic('HP_6');});
	Event.observe('HP_7', 'mouseover', function(){setHPPic('HP_7');});
	Event.observe('HP_8', 'mouseover', function(){setHPPic('HP_8');});
  Event.observe('HP_9', 'mouseover', function(){setHPPic('HP_9');});
  Event.observe('HP_10', 'mouseover', function(){setHPPic('HP_10');});
	Event.observe('HP_11', 'mouseover', function(){setHPPic('HP_11');});

	//clubhouse
	Event.observe('CH_1', 'mouseover', function(){setCHPic('CH_1');});
  Event.observe('CH_2', 'mouseover', function(){setCHPic('CH_2');});
	Event.observe('CH_3', 'mouseover', function(){setCHPic('CH_3');});
	Event.observe('CH_4', 'mouseover', function(){setCHPic('CH_4');});
  Event.observe('CH_5', 'mouseover', function(){setCHPic('CH_5');});
  Event.observe('CH_6', 'mouseover', function(){setCHPic('CH_6');});
	Event.observe('CH_7', 'mouseover', function(){setCHPic('CH_7');});
	Event.observe('CH_8', 'mouseover', function(){setCHPic('CH_8');});
  Event.observe('CH_9', 'mouseover', function(){setCHPic('CH_9');});
  Event.observe('CH_10', 'mouseover', function(){setCHPic('CH_10');});
	Event.observe('CH_11', 'mouseover', function(){setCHPic('CH_11');});

	//commercial
  Event.observe('CI_1', 'mouseover', function(){setCIPic('CI_1');});
  Event.observe('CI_2', 'mouseover', function(){setCIPic('CI_2');});
	Event.observe('CI_3', 'mouseover', function(){setCIPic('CI_3');});
	Event.observe('CI_4', 'mouseover', function(){setCIPic('CI_4');});
  Event.observe('CI_5', 'mouseover', function(){setCIPic('CI_5');});
  Event.observe('CI_6', 'mouseover', function(){setCIPic('CI_6');});
	Event.observe('CI_7', 'mouseover', function(){setCIPic('CI_7');});
	Event.observe('CI_8', 'mouseover', function(){setCIPic('CI_8');});
  Event.observe('CI_9', 'mouseover', function(){setCIPic('CI_9');});
  Event.observe('CI_10', 'mouseover', function(){setCIPic('CI_10');});
	Event.observe('CI_11', 'mouseover', function(){setCIPic('CI_11');});
	
});

// specific functions
function setMFPic (id) {
 	var element = 'multiPic';
	var dir = 'multi/';
  setPic(element, dir, id);
}

function setSFPic (id) {
 	var element = 'singlePic';
	var dir = 'single/';
	setPic(element, dir, id);
}

function setHPPic (id) {
 	var element = 'historicPic';
	var dir = 'historic/';	
  setPic(element, dir, id);	
}

function setCHPic (id) {
 	var element = 'clubhousePic';
	var dir = 'clubhouse/';	
  setPic(element, dir, id);	
}

function setCIPic (id) {
 	var element = 'commercialPic';
	var dir = 'commercial/';	
  setPic(element, dir, id);	
}

 // general  function
function setPic(element, dir, id) {
	//$(id).toggleClassName('On');
	if(id !== 'blank') {
	 $(element).src = baseDir + dir + id + ext;
	} else {
	 $(element).src = baseDir + 'blank.gif';
	}
	//alert(element + ' - ' + baseDir + dir + id + ext)

}
