function center(box){
	//var boxh = 250;
	var boxw = box;
	var w = jQuery(window).width();
	//var h = jQuery(window).height();
	
	var x = (w/2 - boxw/2);
	//var y = (h/2 - boxh/2);

	jQuery('#work').css({width:box,left:x});
}

function popBox(bwidth,fspeed,sspeed,include){
	var iev = getInternetExplorerVersion();
	if (iev !=6.0){
		jQuery('#acontainer').fadeIn(fspeed);
		center(bwidth);
		jQuery('#work').slideToggle('normal');
		jQuery.get('/includes/'+include,function(data){jQuery('#work').html(data);});
	}
	else {
		window.open('/includes/popwin.cfm?page='+include, '', 'scrollbars=yes,width=640,height=500');
	}
	
}

function slideIt(id){
	var tot =6;
	var i = 1;
	for (i;i<=tot;i++){
		jQuery('#s'+i).hide('slow');	
	}
	jQuery('#s'+id).toggle('slow');	
}

function getInternetExplorerVersion()
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
*/

var win = null;
function NewWindow(mypage,myname,w,h,scrol){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrol+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win = window.open(mypage+'.htm',myname,settings);
}
