// JavaScript Document
//setup gallery swf
var timestampjs = new Date().getTime();
var flashvars = {};
flashvars.xml = "/xml/gallery.xml?"+timestampjs;
var params = {};
params.menu = "false";
params.base = "/swf/";
params.wmode = "transparent";
var attributes = {};

swfobject.embedSWF("/swf/gallery.swf", "leftFlash", "312", "193", "10.0.0", "/swf/expressInstall.swf", flashvars, params, attributes);

$(function(){
		   
	$('div[id=overlaysBox] a.nyroModal').nyroModal({minWidth: 650,minHeight: 650,width: 650,height: 650});
	$('div[id=galleriesBox] a.nyroModal').nyroModal({minWidth: 602,minHeight: 550,width: 602,height: 550});
	$('div[class=galleriesBox] a.nyroModal').nyroModal({minWidth: 602,minHeight: 550,width: 602,height: 550});
});

//setup video player
function setupVideo(pathToFLV, widthFLV, heightFLV)
{

	$('#video').css('width', widthFLV);
    $('#video').css('height', heightFLV);
	
	
	var flashvars = {};
    flashvars.flv = pathToFLV;
    swfobject.embedSWF("/swf/player.swf", "videoPlayer", widthFLV, heightFLV, "10.0.0", "/swf/expressInstall.swf", flashvars, params, attributes);


   $(document).ready(function() {
		/*$.nyroModalSettings({
			minWidth: widthFLV,
			minHeight: heightFLV,
			width: widthFLV,
			height: heightFLV
		});*/
		$.fn.nyroModal.settings.minWidth = widthFLV;
		$.fn.nyroModal.settings.minHeight = heightFLV;
		$.fn.nyroModal.settings.width = widthFLV;
		$.fn.nyroModal.settings.height = heightFLV;
	});
}



//setupVideo('http://lvideos.5min.com/103385/10338494.flv');
//setup sifr make h1 sa swf
var TheSans = { src: '/swf/TheSans.swf' };
sIFR.activate(TheSans);

sIFR.replace(TheSans, {
	selector: 'h1',
	offsetTop: 3,
	wmode: 'transparent',
	css: [
		'.sIFR-root { color: #552580; leading: 10; }',
		'.orange_text { color: #e2ba02; }',
        'a { text-decoration: none; color: inherit; }',
        'a:hover { text-decoration: none; color: inherit; }',
        'a:visited { text-decoration: none; color: inherit; }'
	]
});

$(document).ready(function() {
    $('#galleryhomeid').cycle('fade');
	
	//set height of GrayBlockMiddle colume
	var height = 0;
	$(".GrayBlockMiddle .inner").each( function(index) { 
		var h = $(this).height();
		if (h > height) {
			height = h;
		}
	});
	$(".GrayBlockMiddle .inner").height(height);
	

	//fix background color in overlay
	$('div[id=overlaysBox] a.nyroModal').click(function() {
		$("#nyroModalContent").css("background-color", "#FFF");
	});
	
	$('div[id=galleriesBox] a.nyroModal').click(function() {
		$("#nyroModalContent").css("background-color", "#000");
	});
	
	$('div[class=galleriesBox] a.nyroModal').click(function() {
		$("#nyroModalContent").css("background-color", "#000");
	});
})
