// JavaScript Document

var currentpos_condos=0;
var current_imgid_condos=0;
var moving_condos = false;
var finishedsizing_condos=0;
var preloadimg_condos="no"//Preload images ("yes" or "no"):
var myloadedimage_condos = new Array();
     myloadedimage_condos[0]=1;
var imggallery_condos=new Array()
var firstimagestart_condos=1;
var nextorprev_condos=0;
var fadeout_condos=1;

function areweready_condos(loadarea, imgindex, img_id){
	if ( finishedsizing_condos++ ) { 
		modifyimage_condos(loadarea, imgindex, img_id);
		finishedsizing_condos = 0;
	}
}

function modifyimage_condos(loadarea, imgindex, img_id ){
	function loadimagenow(){
		if (document.getElementById) {
			
				if(current_imgid_condos!=img_id){
					
					var imgobj=document.getElementById(loadarea);
					var phototitle=document.getElementById('desc_condos')
					
					imgobj.innerHTML=returnimgcode_condos(imggallery_condos[imgindex]);
					phototitle.innerHTML="<strong style='text-transform:uppercase'>"+ tempgallery_condos[imgindex][5] +"</strong> <br />"+ tempgallery_condos[imgindex][6];
					initImage_condos(loadarea);
					current_imgid_condos=img_id;
					myloadedimage_condos[imgindex]=1;
				}
			}
		return false
	}
	if(myloadedimage_condos[imgindex]==null){	
		new Asset.image(imggallery_condos[imgindex][0], {onload: loadimagenow});
		
	}else{
		loadimagenow();
	}
	
}

function returnimgcode_condos(theimg){
	var imghtml=""
	if (theimg[1]!="")
		imghtml=''
	imghtml+='<a href="'+theimg[7]+'" target="_self"><img src="'+theimg[0]+'" border="0" id="'+theimg[8]+'" /></a>'
	if (theimg[1]!="")
		imghtml+=''
	return imghtml
}


function initImage_condos(imageId) {
	
	var fader = new Fx.Style(imageId,'opacity', {duration:fadespeed});
	fader.set(0);
	fader.start(0,1);
	
	var titlefade = new Fx.Style('desc_condos','opacity', {duration:transspeed });
		titlefade.set(0);
		titlefade.start(0,1);
}

function addposition_condos(addwidth){
	if ( !moving_condos ) {
		 // if animagic is still moving_condos the image..don't update the current position till it's done
		if(addwidth=="minus"){
			currentpos_condos-=1;
		}else if(addwidth=="plus"){
			currentpos_condos+=1;
		}
	}
	return currentpos_condos;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

	
function timedMsg_condos()
{
	if (window.t_bool_condos) {
		if (tempgallery_condos.length > 1) {
			if (current_imgid_condos + 1 >= tempgallery_condos.length ) {
				current_imgid_condos = 1;
				previmageConDos(current_imgid_condos);
			} 
			else nextimageConDos(current_imgid_condos);
		}
	}
}

function cleartimedMsg_condos(reload_trans) {
	window.t_bool_condos = false;
	var x = window.setTimeout("reloadtimedMsg_condos();", reload_trans);
}

function reloadtimedMsg_condos() {
	window.t_bool_condos = true;
}

