gID = function(e) { return document.getElementById(e); }
var galleryVisible = false;
launchGallery = function (btn){
	showGallery();
	//alert('flashLaunch');
}
showGallery = function(){
	jQuery('#galleryUI').show();
}
hideGallery = function(){
	jQuery('#galleryUI').hide();
}
jQuery('#flashContent').ready(function(){
	var leftPos = gID("flashContent").offsetLeft;
	gID("galleryUI").style.left = leftPos + 'px';
	leftPos = gID("flashContent").offsetLeft + 295;
	gID("player").style.left = leftPos + 'px';
	leftPos = gID("flashContent").offsetLeft + 235;
	gID("comment").style.left = leftPos + 'px';
	//populateGallery("steveo",1,"color","Tattoo");
});

// temporary; move to XML
var commentContent = new Array();
commentContent.title = new Array();
commentContent.title[0] = "About Us";
commentContent.title[1] = "Shop Photos";
commentContent.title[2] = "Merchandise";
commentContent.title[3] = "Press";
commentContent.title[4] = "Awards";
commentContent.title[5] = "Local Bands";
commentContent.body = new Array();
commentContent.body[0] = "Featuring custom tattoos, piercings, paintings, prints and tattoo flash by award winning artists!<br><br><b>Hourly Rate:</b> $150 per hour (min 1hr)<br><br><b>Tue, Wed, Thur:</b> 2pm - 8pm<br><b>Fri, Sat:</b> 12pm - 8pm<br><b>Sun - Mon:</b> By Appointment Only<br><br>Single service needles.<br><br>Credit and ATM Accepted";
commentContent.body[1] = "<img src=\"images/shop/front_day_tmb.jpg\" width=\"275\"><br><br><img src=\"images/shop/front_night_tmb.jpg\" width=\"275\"><br><br><img src=\"images/shop/front_window_tmb.jpg\" width=\"275\"><br><br><img src=\"images/shop/lobby1_tmb.jpg\" width=\"275\"><br><br>";
commentContent.body[1] += "<img src=\"images/shop/lobby2_tmb.jpg\" width=\"275\"><br><br><img src=\"images/shop/lobby3_tmb.jpg\" width=\"275\"><br><br><img src=\"images/shop/lobby4_tmb.jpg\" width=\"275\"><br><br><img src=\"images/shop/lobby5_tmb.jpg\" width=\"275\"><br><br>";
commentContent.body[1] += "<img src=\"images/shop/lobby6_tmb.jpg\" width=\"275\"><br><br><img src=\"images/shop/work_area1_tmb.jpg\" width=\"275\"><br><br><img src=\"images/shop/work_area2_tmb.jpg\" width=\"275\"><br><br><img src=\"images/shop/window_tmb.jpg\" width=\"275\">";
commentContent.body[2] = "We\'ve got a wide array of different shirts, hoodies, and more.<br><br>Check back soon for info. Stop by the shop to see what\'s in stock.";
commentContent.body[3] = "<img src=\"images/press/mag1.jpg\" width=\"170\"><br><img src=\"images/press/mag2.jpg\" width=\"170\"><br><img src=\"images/press/mag3.jpg\" width=\"170\"><br><img src=\"images/press/mag4.jpg\" width=\"170\"><br><img src=\"images/press/mag5.jpg\" width=\"170\"><br><img src=\"images/press/mag6.jpg\" width=\"170\"><br><img src=\"images/press/mag7.jpg\" width=\"170\"><br><img src=\"images/press/mag8.jpg\" width=\"170\"><br><img src=\"images/press/mag9.jpg\" width=\"170\"><br><img src=\"images/press/mag10.jpg\" width=\"170\"><br><img src=\"images/press/mag11.jpg\" width=\"170\"><br>";
commentContent.body[3] += "<img src=\"images/press/mag12.jpg\" width=\"170\"><br><img src=\"images/press/mag13.jpg\" width=\"170\"><br><img src=\"images/press/mag14.jpg\" width=\"170\"><br><img src=\"images/press/mag15.jpg\" width=\"170\"><br><img src=\"images/press/mag16.jpg\" width=\"170\"><br><img src=\"images/press/mag17.jpg\" width=\"170\"><br><img src=\"images/press/mag18.jpg\" width=\"170\"><br><img src=\"images/press/mag19.jpg\" width=\"170\"><br><img src=\"images/press/mag20.jpg\" width=\"170\"><br><img src=\"images/press/mag21.jpg\" width=\"170\"><br><img src=\"images/press/mag22.jpg\" width=\"170\"><br>";
commentContent.body[3] += "<img src=\"images/press/mag23.jpg\" width=\"170\"><br><img src=\"images/press/mag24.jpg\" width=\"170\"><br><img src=\"images/press/mag25.jpg\" width=\"170\"><br><img src=\"images/press/mag26.jpg\" width=\"170\"><br><img src=\"images/press/mag27.jpg\" width=\"170\"><br><img src=\"images/press/mag28.jpg\" width=\"170\"><br><img src=\"images/press/mag29.jpg\" width=\"170\"><br><img src=\"images/press/mag30.jpg\" width=\"170\"><br><img src=\"images/press/mag31.jpg\" width=\"170\"><br><img src=\"images/press/mag32.jpg\" width=\"170\">";
commentContent.body[4] = "<b>Steve'O's Awards:</b><br><img src=\"images/awards/steveo1_tmb.png\" width=\"275\"><br><img src=\"images/awards/steveo2_tmb.png\" width=\"275\"><br><img src=\"images/awards/steveo3_tmb.jpg\" width=\"275\"><br><img src=\"images/awards/steveo4_tmb.jpg\" width=\"275\">";
commentContent.body[4] += "<br><br><b>Eddie's Awards:</b><br><img src=\"images/awards/eddie1_tmb.jpg\" width=\"275\"><br><img src=\"images/awards/eddie2_tmb.jpg\" width=\"275\"><br><br><b>Jesse's Award:</b><br><img src=\"images/awards/jesse1_tmb.jpg\" width=\"275\">";
commentContent.body[5] = "<b>Middle Class Rut</b> :: <a href=\"http://www.myspace.com/middleclassrut\" target=\"_new\">Website</a><img src=\"http://a222.ac-images.myspacecdn.com/images01/11/l_e4f4a7c748b1ff957da488ffa5b59cbd.jpg\" width=\"250\"><br><br>";
commentContent.body[5] += "<b>FFG</b> :: <a href=\"http://www.myspace.com/ffg\" target=\"_new\">Website</a><br><img src=\"http://i22.photobucket.com/albums/b328/ffgjarret/Finalmyspace.jpg\" width=\"250\"><br><br>";
commentContent.body[5] += "<b>One Dying Secret</b> :: <a href=\"http://www.myspace.com/onedyingsecret\" target=\"_new\">Website</a><img src=\"http://a127.ac-images.myspacecdn.com/images01/86/l_c758eb949d869a5965fd4c8c9628a596.jpg\" width=\"250\"><br><br>";
commentContent.body[5] += "<b>Without Tomorrow</b> :: <a href=\"http://www.myspace.com/withouttomorrow\" target=\"_new\">Website</a><img src=\"http://a212.ac-images.myspacecdn.com/images01/2/l_5bc2bd4f7a8aaa2aea613c6829c62b83.jpg\" width=\"250\">";

jQuery('#title').ready(function(){
createComment = function(id){
	gID("title").innerHTML = commentContent.title[id];
	gID("scroller").innerHTML = commentContent.body[id];
	jQuery('#comment').show();
}
});

closePop = function(n){
	switch(n){
		case 0: jQuery('#comment').hide(); break;
		case 1: jQuery('#galleryUI').hide(); break;
		default: break;
	}
}
artistClick = function(name){
	//showGallery();
	//populateGallery(name,1,"color","Tattoo");
	window.open('images/'+name+'/zombie.jpg');
}
var displayNum = 0;
var numPhotos = new Array();
var niceName = '';
populateGallery = function(id,index,type,media){ // id = artist, index = beginning photo index, type = color, black, media = Tattoo, Canvas
	//alert('populateGallery');
	//loadFlash('test\/gallery','gallery',770,550);
	/*
	switch(id){
		case 'steveo': niceName = "Steve'O"; break;
		case 'eddie': niceName = "Eddie"; break;
		case 'johnathan': niceName = "Johnathan"; break;
		case 'lucky': niceName = "Lucky"; break;
	}
	switch(type){
		case 'color': numPhotos.steveo = 112; numPhotos.eddie = 1; numPhotos.johnathan = 1; numPhotos.lucky = 1; break;
		case 'new': numPhotos.steveo = 6; numPhotos.eddie = 0; numPhotos.johnathan = 0; numPhotos.lucky = 0; break;
		case 'blkGry': numPhotos.steveo = 27; numPhotos.eddie = 0; numPhotos.johnathan = 0; numPhotos.lucky = 0; break;
		case 'skull': numPhotos.steveo = 27; numPhotos.eddie = 0; numPhotos.johnathan = 0; numPhotos.lucky = 0; break;
		case 'other': numPhotos.steveo = 7; numPhotos.eddie = 0; numPhotos.johnathan = 0; numPhotos.lucky = 0; break;
		default: break;
	}
	var folderID;
	displayNum = numPhotos[id];
	switch(media){
		case 'Tattoo': folderID = "tattoos"; break;
		case 'Flash': folderID = "flash"; break;
		case 'Paintings': folderID = "paintings"; break;
		default: break;
	}
	var galleryContents = '';
	for(i=1;i<=displayNum;i++){
		galleryContents += '<div class="floatLeft img" id="image'+i+'">';
		galleryContents += '<a href="works/'+id+'/'+folderID+'/'+type+'/'+type+media+'%20('+i+').jpg" rel="lightbox['+type+']" title="'+type+' '+media+' by '+niceName+'"><img src="works/'+id+'/'+folderID+'/'+type+'/'+type+media+'%20('+i+').jpg" width="140" border="0"></a>';
		galleryContents += '</div>';
	}
	jQuery("#galleryMain").animate({ top: 0 }, "fast");
	gID("galleryMain").innerHTML = galleryContents;
	*/
}

move = function(dir){
	var topPos = gID("galleryMain").offsetTop;
	var galleryHeight = gID("galleryMain").offsetHeight;
	var top_height_offSet = galleryHeight - (Math.abs(topPos));
	//alert(topPos);
	//alert(galleryHeight);
	//alert(top_height_offSet);
	if(dir=='next'){
		if(top_height_offSet > 364){ topPos = topPos - 187; }
	}
	else {
		if(topPos != 0){ topPos = topPos + 187; }
	}
	jQuery("#galleryMain").animate({ top: topPos }, "slow");
}
loadFlash = function(objPath,id,width,height){
	AC_FL_RunContent(
		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
		'width', width,
		'height', height,
		'src', objPath,
		'quality', 'high',
		'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
		'align', 'middle',
		'play', 'true',
		'loop', 'true',
		'scale', 'showall',
		'wmode', 'transparent',
		'devicefont', 'false',
		'id', id,
		'bgcolor', '#010101',
		'name', id,
		'menu', 'true',
		'allowFullScreen', 'false',
		'allowScriptAccess','always',
		'movie', objPath,
		'salign', ''
		); //end AC code
}