// JavaScript Document

var currentpos_conuno=0;
var current_imgid_conuno=0;
var moving_conuno = false;
var finishedsizing_conuno=0;
var preloadimg_conuno="no"//Preload images ("yes" or "no"):
var myloadedimage_conuno = new Array();
     myloadedimage_conuno[0]=1;
var imggallery_conuno=new Array()
var firstimagestart_conuno=1;
var nextorprev_conuno=0;
var fadeout_conuno=1;

function areweready_conuno(loadarea, imgindex, img_id){
	if ( finishedsizing_conuno++ ) { 
		modifyimage_conuno(loadarea, imgindex, img_id);
		finishedsizing_conuno = 0;
	}
}

function modifyimage_conuno(loadarea, imgindex, img_id ){
	function loadimagenow(){
		if (document.getElementById) {
			
				if(current_imgid_conuno!=img_id){
					
					var imgobj=document.getElementById(loadarea);
					var phototitle=document.getElementById('desc_conuno')
					
					imgobj.innerHTML=returnimgcode_conuno(imggallery_conuno[imgindex]);
					phototitle.innerHTML="<strong  style='text-transform:uppercase'>"+ tempgallery_conuno[imgindex][5] +"</strong> <br />"+ tempgallery_conuno[imgindex][6];
					initImage_conuno(loadarea);
					current_imgid_conuno=img_id;
					myloadedimage_conuno[imgindex]=1;
				}
			}
		return false
	}
	if(myloadedimage_conuno[imgindex]==null){	
		new Asset.image(imggallery_conuno[imgindex][0], {onload: loadimagenow});
		
	}else{
		loadimagenow();
	}
	
}

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

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

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

	
function timedMsg_conuno()
{
	if (window.t_bool_conuno) {
		if (tempgallery_conuno.length > 1) { 
			if (current_imgid_conuno + 1 >= tempgallery_conuno.length ) {
				current_imgid_conuno = 1;
				previmageConUno(current_imgid_conuno);
			} 
			else nextimageConUno(current_imgid_conuno);
		}
	}
}

function cleartimedMsg_conuno(reload_trans) {
	window.t_bool_conuno = false;
	var x = window.setTimeout("reloadtimedMsg_conuno();", reload_trans);
}

function reloadtimedMsg_conuno() {
	window.t_bool_conuno = true;
}

