jQuery.noConflict();
jQuery(function(){
  jQuery.fn.nyroModal.settings.processHandler = function(settings) {
    var from = settings.from;
	var dim = from.rel.split("x");
	var w = parseInt(dim[0]);
	var h = parseInt(dim[1]);
	if(isNaN(w)) w = 800;
	if(isNaN(h)) h = 600;
    if (from && from.href) {
      jQuery.nyroModalSettings({
        type: 'swf',
        height: h,
        width: w,
        url: from.href
      });
    }
  };
  jQuery('ul.images li a.more-flash').click(function() {
	var parent 	= jQuery(this).parent().parent().parent().get(0);
	var first 	= jQuery(parent).find("li:first a.nyroModal");
	if(first) {
		var dim = jQuery(first).attr('rel').split("x");
		var w = parseInt(dim[0]);
		var h = parseInt(dim[1]);
		if(isNaN(w)) w = 800;
		if(isNaN(h)) h = 600;
		jQuery('ul.images li a.nyroModal').nyroModalManual({type:'swf',height:h,width:h,url:jQuery(first).attr('href')});
	}
  });
  jQuery('ul.images li a.nyroModal').click(function() {
	var dim = jQuery(this).attr('rel').split("x");
	var w = parseInt(dim[0]);
	var h = parseInt(dim[1]);
	if(isNaN(w)) w = 800;
	if(isNaN(h)) h = 600;
	jQuery(this).nyroModalManual({type:'swf',height:h,width:h,url:jQuery(this).attr('href')});  	
  
  });
  
    jQuery('div.download-box').click(function() {
	jQuery(this).find('ul').toggleClass("hide");
	if(jQuery(this).find('ul').hasClass("hide"))
	jQuery('#content-wrapper').css('paddingBottom','0');
	else
	jQuery('#content-wrapper').css('paddingBottom','150px');
	
	//return false;
  });
  jQuery('div.download-box').dblclick( function() {
	var elem = $(this);
        elem.onselectstart = function() { return false; };
        elem.style.MozUserSelect = "none";
        elem.style.KhtmlUserSelect = "none";
        elem.unselectable = "on";
 	//return false;
  });
});