//-- init
$(document).ready(function() {
	$('#main_table tr:odd').addClass('odd_rows')
		.mouseover(
			function() {$(this).attr('style', 'background:#4095D4;')}
		)
		.mouseout(
			function() {$(this).attr('style', '')}
		);
	$('#main_table tr:even').addClass('even_rows')
		.mouseover(
			function() {$(this).attr('style', 'background:#4095D4;')}
		)
		.mouseout(
			function() {$(this).attr('style', '')}
		);
	
	
	$('.cluetip_default[title]').cluetip({
  	cluetipClass: 'jtip',
  	splitTitle: '|', 
  	arrows: true,
  	dropShadow: false,
  	showTitle:false,
  	hoverIntent: false,
  	positionBy: 'mouse', 
  });
	$('.cluetip_flag[title]').cluetip({
  	cluetipClass: 'jtip',
  	splitTitle: '|', 
  	arrows: true,
  	dropShadow: false,
  	showTitle:false,
  	hoverIntent: false,
  	positionBy: 'mouse', 
  	width:'62px',
  	height:'54px',
  });
  $('#remotefile[title]:eq(0)').cluetip({
		cluetipClass: 'jtip',
  	splitTitle: '|', 
  	arrows: true,
  	dropShadow: false,
  	showTitle:false,
  	hoverIntent: false,
  	sticky: true,
  	ajaxCache: false,
  	mouseOutClose: true,
  	closePosition: 'title',
  	closeText: '<img src="js/images/cross.png" alt="close" />',
  	positionBy: 'mouse', 
  });
  $('span.cluetip_exif[title]:eq(0)').cluetip({
  	cluetipClass: 'jtip',
  	splitTitle: '|', 
  	arrows: true,
  	dropShadow:true,
  	showTitle:false,
  	hoverIntent:false,
  	sticky:false,
  	ajaxCache:false,
  	mouseOutClose:true,
  	closePosition:'title',
  	closeText: '<img src="js/images/cross.png" alt="close" />',
  	positionBy: 'mouse', 
  	width:'512px',
  	height:'130px',
  });

	$('span').each(
    function() {
      with($(this)) {
      	if(attr('id').substr(0,6) == 'updsec') {
      		var id = attr('id').substr(6);
      		var href = attr('value');
      		$('#aupdsec'+id).attr('href', href);
      		$('#aupdsec'+id).attr('class', 'colorbox_update');
      		//$('#aupdsec'+id).attr('title', 'Update');
      	}
      	if(attr('id').substr(0,6) == 'copsec') {
      		var id = attr('id').substr(6);
      		var href = attr('value');
      		$('#acopsec'+id).attr('href', href);
      		$('#acopsec'+id).attr('class', 'colorbox_copy');
      		//$('#acopsec'+id).attr('title', 'Copy');
      	}
      	if(attr('id') == 'addsec') {
      		var href = attr('value');
      		$('#aaddsec').attr('href', href);
      		$('#aaddsec').attr('class', 'colorbox_update');
      	}
      }
    }
  );

	var close_btn = '<img src="js/images/close.png" width="23px" title="Close">';
  /*
  $('.colorbox_copy').colorbox({
		initWidth:'350px',
		initHeight:'180px',
		width:'350px',
		height:'180px',
		close: close_btn
	});
	$('.colorbox_update').colorbox({
		initWidth:'600px',
		initHeight:'90%',
		width:'600px',
		height:'90%',
		transition:"fade",
		preloading:true,
		opacity:0.75,
		slideshow:true,
		slideshowSpeed:2500,
		close: close_btn
	});
	*/
});

