// JavaScript Document

var currentpos_concuatro=0;
var current_imgid_concuatro=0;
var moving_concuatro = false;
var finishedsizing_concuatro=0;
var preloadimg_concuatro="no"//Preload images ("yes" or "no"):
var myloadedimage_concuatro = new Array();
     myloadedimage_concuatro[0]=1;
var imggallery_concuatro=new Array()
var firstimagestart_concuatro=1;
var nextorprev_concuatro=0;
var fadeout_concuatro=1;

function areweready_concuatro(loadarea, imgindex, img_id){
	if ( finishedsizing_concuatro++ ) { 
		modifyimage_concuatro(loadarea, imgindex, img_id);
		finishedsizing_concuatro = 0;
	}
}

function modifyimage_concuatro(loadarea, imgindex, img_id ){
	function loadimagenow(){
		if (document.getElementById) {
			
				if(current_imgid_concuatro!=img_id){
					
					var imgobj=document.getElementById(loadarea);
					var phototitle=document.getElementById('desc_concuatro')
					
					imgobj.innerHTML=returnimgcode_concuatro(imggallery_concuatro[imgindex]);
					phototitle.innerHTML="<strong style='text-transform:uppercase'>"+ tempgallery_concuatro[imgindex][5] +"</strong> <br />"+ tempgallery_concuatro[imgindex][6];
					initImage_concuatro(loadarea);
					current_imgid_concuatro=img_id;
					myloadedimage_concuatro[imgindex]=1;
				}
			}
		return false
	}
	if(myloadedimage_concuatro[imgindex]==null){	
		new Asset.image(imggallery_concuatro[imgindex][0], {onload: loadimagenow});
		
	}else{
		loadimagenow();
	}
	
}

function returnimgcode_concuatro(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_concuatro(imageId) {
	
	var fader = new Fx.Style(imageId,'opacity', {duration:fadespeed});
	fader.set(0);
	fader.start(0,1);
	
	var titlefade = new Fx.Style('desc_concuatro','opacity', {duration:transspeed });
		titlefade.set(0);
		titlefade.start(0,1);
}

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

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

	
function timedMsg_concuatro()
{
	if (window.t_bool_concuatro) {
		if (tempgallery_concuatro.length > 1) {
			if (current_imgid_concuatro + 1 >= tempgallery_concuatro.length ) {
				current_imgid_concuatro = 1;
				previmageConCuatro(current_imgid_concuatro);
			} 
			else nextimageConCuatro(current_imgid_concuatro);
		}
	}
}

function cleartimedMsg_concuatro(reload_trans) {
	window.t_bool_concuatro = false;
	var x = window.setTimeout("reloadtimedMsg_concuatro();", reload_trans);
}

function reloadtimedMsg_concuatro() {
	window.t_bool_concuatro = true;
}

